/* ============================================================
   APP-WIDE STYLES — Auth pages, homepage, profile, etc.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #08090d;
  --bg-card: #11131e;
  --bg-input: #0c0e1c;
  --bg-hover: #1a1d35;
  --text: #eaeaf4;
  --text-sec: #9d9db8;
  --text-muted: #5c5c78;
  --border: rgba(124, 109, 240, 0.12);
  --border-focus: rgba(124, 109, 240, 0.4);
  --accent: #7c6df0;
  --accent-hover: #9488f5;
  --accent-glow: rgba(124, 109, 240, 0.3);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --warning: #fbbf24;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --glass-bg: rgba(14, 16, 32, 0.75);
  --glass-border: rgba(124, 109, 240, 0.1);
  --topbar-h: 56px;
  --sidebar-w: 260px;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  cursor: pointer; border: none; background: none;
  font-family: inherit; font-size: inherit; color: inherit;
}

input, textarea, select {
  font-family: inherit; font-size: inherit;
  color: var(--text); outline: none;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #252850; border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── AUTH PAGES ─────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at top, #13152a 0%, #08090d 60%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow), 0 0 60px rgba(124, 109, 240, 0.04);
}

.auth-card h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.auth-card .subtitle {
  color: var(--text-sec);
  font-size: 14px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group { flex: 1; }

.pw-requirements {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.pw-requirements span {
  display: inline-block;
  margin-right: 8px;
}

.pw-requirements span.met {
  color: var(--success);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #22264a;
  border-color: rgba(124, 109, 240, 0.25);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.25);
}

.btn-sm { padding: 8px 16px; font-size: 12px; }

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-sec);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}

.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
  display: block;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.2);
  display: block;
}

/* ─── MAIN HOMEPAGE LAYOUT ───────────────────────────── */

.app-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(10, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.topbar-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand svg {
  width: 24px; height: 24px;
  stroke: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.announcement-dot {
  position: relative;
}

.announcement-dot .dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.icon-btn {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  transition: all 0.2s;
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.icon-btn svg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none;
  stroke-width: 2;
}

/* Profile dropdown */
.profile-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.profile-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.profile-btn img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.profile-dropdown {
  position: absolute;
  top: calc(var(--topbar-h) - 4px);
  right: 20px;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
  display: none;
}

.profile-dropdown.open { display: block; }

.profile-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.profile-dropdown-header .name {
  font-weight: 600;
  font-size: 14px;
}

.profile-dropdown-header .email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}

.profile-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.profile-dropdown-item svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2;
}

.profile-dropdown-item.danger { color: var(--danger); }

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
}

/* ─── HOME PAGE CONTENT ──────────────────────────────── */

.home-content {
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 28px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.home-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 24px;
  margin-top: 28px;
  margin-bottom: -8px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card:hover {
  border-color: rgba(124, 109, 240, 0.3);
  box-shadow: 0 4px 24px rgba(124, 109, 240, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.tool-card-icon.purple { background: rgba(124, 109, 240, 0.15); color: #7c6df0; }
.tool-card-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.tool-card-icon.green { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.tool-card-icon.orange { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.tool-card-icon.pink { background: rgba(244, 114, 182, 0.15); color: #f472b6; }
.tool-card-icon.red { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.tool-card-icon svg {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none;
  stroke-width: 2;
}

.tool-card h3 {
  font-size: 16px;
  font-weight: 600;
}

.tool-card p {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.5;
}

.tool-card .badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-soon { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.badge-new { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.badge-locked { background: rgba(248, 113, 113, 0.15); color: #f87171; }

/* ─── ANNOUNCEMENTS PANEL ────────────────────────────── */

.announcements-panel {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: calc(100vh - var(--topbar-h));
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.announcements-panel.open {
  transform: translateX(0);
}

.announcements-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.announcements-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.announcement-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 10px;
  background: var(--bg);
}

.announcement-item h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.announcement-item p {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.5;
}

.announcement-item .time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.no-announcements {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ─── SECRET CODE LOCK PAGE ──────────────────────────── */

.code-lock-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #13152a 0%, #08090d 70%);
}

.code-lock-card {
  text-align: center;
  max-width: 380px;
  width: 100%;
  padding: 40px;
}

.code-lock-icon {
  width: 80px; height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: rgba(124, 109, 240, 0.1);
  border: 2px solid rgba(124, 109, 240, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-lock-icon svg {
  width: 36px; height: 36px;
  stroke: var(--accent); fill: none;
  stroke-width: 2;
}

.code-lock-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.code-lock-card .sub {
  color: var(--text-sec);
  font-size: 13px;
  margin-bottom: 28px;
}

.code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.code-digit {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  transition: all 0.2s;
}

.code-digit:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.code-digit.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ─── OWNER PANEL ────────────────────────────────────── */

.panel-layout {
  display: flex;
  min-height: 100vh;
}

.panel-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding-top: 20px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.panel-sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-sidebar-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-sidebar-header h2 svg {
  width: 20px; height: 20px;
  stroke: var(--accent); fill: none; stroke-width: 2;
}

.panel-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.panel-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}

.panel-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.panel-nav-item.active {
  background: rgba(124, 109, 240, 0.12);
  color: var(--accent);
}

.panel-nav-item svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 2;
  flex-shrink: 0;
}

.panel-nav-item .badge-count {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.panel-nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 16px 14px 6px;
}

.panel-content {
  margin-left: var(--sidebar-w);
  padding: 28px;
  flex: 1;
}

.panel-content h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sec);
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── CHAT LAYOUT ────────────────────────────────────── */

.chat-layout {
  display: flex;
  height: 100vh;
}

.chat-sidebar {
  width: 300px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-sidebar-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.chat-room-list {
  flex: 1;
  overflow-y: auto;
}

.chat-room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 1px solid var(--border);
}

.chat-room-item:hover, .chat-room-item.active {
  background: var(--bg-hover);
}

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

.chat-room-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-room-info {
  flex: 1;
  min-width: 0;
}

.chat-room-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-room-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  display: flex;
  gap: 10px;
  max-width: 80%;
}

.chat-message.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

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

.chat-msg-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ─── Premium Profile Borders (Chat + Everywhere) ─── */
.chat-msg-avatar.border-bronze {
  box-shadow: 0 0 0 2px #cd7f32, 0 0 6px rgba(205,127,50,0.3);
}
.chat-msg-avatar.border-silver {
  box-shadow: 0 0 0 2px #c0c0c0, 0 0 6px rgba(192,192,192,0.3);
}
.chat-msg-avatar.border-gold {
  box-shadow: 0 0 0 2px #ffd700, 0 0 8px rgba(255,215,0,0.35);
}
.chat-msg-avatar.border-diamond {
  box-shadow: 0 0 0 2px #e0c3fc, 0 0 10px rgba(224,195,252,0.4);
  animation: diamondShimmer 3s ease-in-out infinite alternate;
}
@keyframes diamondShimmer {
  0% { box-shadow: 0 0 0 2px #e0c3fc, 0 0 10px rgba(224,195,252,0.4); }
  50% { box-shadow: 0 0 0 2px #ffd700, 0 0 12px rgba(255,215,0,0.4); }
  100% { box-shadow: 0 0 0 2px #e0c3fc, 0 0 10px rgba(224,195,252,0.4); }
}

/* Profile borders for profile page and other avatars */
.profile-avatar.border-bronze { box-shadow: 0 0 0 3px #cd7f32, 0 0 8px rgba(205,127,50,0.3); }
.profile-avatar.border-silver { box-shadow: 0 0 0 3px #c0c0c0, 0 0 8px rgba(192,192,192,0.3); }
.profile-avatar.border-gold { box-shadow: 0 0 0 3px #ffd700, 0 0 10px rgba(255,215,0,0.35); }
.profile-avatar.border-diamond {
  box-shadow: 0 0 0 3px #e0c3fc, 0 0 12px rgba(224,195,252,0.4);
  animation: diamondShimmer 3s ease-in-out infinite alternate;
}

/* Generic border class for any avatar element */
.premium-border-bronze { box-shadow: 0 0 0 2px #cd7f32, 0 0 6px rgba(205,127,50,0.3); }
.premium-border-silver { box-shadow: 0 0 0 2px #c0c0c0, 0 0 6px rgba(192,192,192,0.3); }
.premium-border-gold { box-shadow: 0 0 0 2px #ffd700, 0 0 8px rgba(255,215,0,0.35); }
.premium-border-diamond {
  box-shadow: 0 0 0 2px #e0c3fc, 0 0 10px rgba(224,195,252,0.4);
  animation: diamondShimmer 3s ease-in-out infinite alternate;
}

.chat-msg-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
}

.chat-msg-content {
  padding: 10px 14px;
  border-radius: 12px 12px 12px 4px;
  background: var(--bg-hover);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-message.own .chat-msg-content {
  background: var(--accent);
  color: #fff;
  border-radius: 12px 12px 4px 12px;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-muted);
}

.chat-input-area {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  resize: none;
}

.chat-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-send-btn {
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s;
}

.chat-send-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 12px var(--accent-glow);
}

.chat-send-btn svg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none; stroke-width: 2;
}

.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── PROFILE PAGE ───────────────────────────────────── */

.profile-page {
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.profile-container {
  max-width: 600px;
  margin: 28px auto;
  padding: 0 20px;
}

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.profile-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-pfp-area {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.profile-pfp-preview {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.profile-pfp-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ─── MODAL ──────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ─── UTILITIES ──────────────────────────────────────── */

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }

/* ============================================================
   PREMIUM PAGE STYLES
   ============================================================ */

.premium-page {
  padding-top: var(--topbar-h);
  min-height: 100vh;
  background: radial-gradient(ellipse at top center, rgba(124, 109, 240, 0.06) 0%, transparent 60%);
}

.premium-hero {
  text-align: center;
  padding: 60px 24px 40px;
  max-width: 700px;
  margin: 0 auto;
  animation: fadeInUp 0.6s ease-out;
}

.premium-hero h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.premium-hero p {
  font-size: 16px;
  color: var(--text-sec);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.tier-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  animation: fadeInUp 0.6s ease-out backwards;
  overflow: hidden;
}

.tier-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.tier-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.tier-card:nth-child(1) { animation-delay: 0.1s; }
.tier-card:nth-child(2) { animation-delay: 0.2s; }
.tier-card:nth-child(3) { animation-delay: 0.3s; }

/* Bronze tier */
.tier-card.bronze::before {
  background: linear-gradient(90deg, #cd7f32, #e8a85c);
}

.tier-card.bronze:hover {
  border-color: rgba(205, 127, 50, 0.3);
  box-shadow: 0 20px 60px rgba(205, 127, 50, 0.1);
}

.tier-card.bronze .tier-name {
  color: #cd7f32;
}

/* Silver tier */
.tier-card.silver::before {
  background: linear-gradient(90deg, #a8a8a8, #e0e0e0, #a8a8a8);
}

.tier-card.silver:hover {
  border-color: rgba(192, 192, 192, 0.3);
  box-shadow: 0 20px 60px rgba(192, 192, 192, 0.1);
}

.tier-card.silver .tier-name {
  color: #c0c0c0;
}

/* Gold tier */
.tier-card.gold::before {
  background: linear-gradient(90deg, #daa520, #ffd700, #daa520);
}

.tier-card.gold:hover {
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 20px 60px rgba(255, 215, 0, 0.12);
}

.tier-card.gold .tier-name {
  color: #ffd700;
}

.tier-card.gold .tier-popular {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, #ffd700, #daa520);
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 12px;
  border-radius: 20px;
}

.tier-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.tier-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.tier-price .amount {
  font-size: 42px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -2px;
}

.tier-price .period {
  font-size: 14px;
  color: var(--text-muted);
}

.tier-price .currency {
  font-size: 18px;
  color: var(--text-sec);
  font-weight: 600;
  align-self: flex-start;
  margin-top: 8px;
}

.tier-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.tier-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-sec);
}

.tier-features li::before {
  content: '\2713';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.tier-features li.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.5;
}

.tier-features li.disabled::before {
  content: '\2717';
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
}

.pay-ahead-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  animation: pulseGlow 2.5s ease-in-out infinite;
}

.pay-ahead-badge::before {
  content: '\2605';
  font-size: 14px;
}

.tier-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.tier-cta.bronze-cta {
  background: linear-gradient(135deg, #cd7f32, #a0622a);
  color: #fff;
  box-shadow: 0 4px 20px rgba(205, 127, 50, 0.25);
}

.tier-cta.bronze-cta:hover {
  box-shadow: 0 8px 30px rgba(205, 127, 50, 0.4);
  transform: translateY(-2px);
}

.tier-cta.silver-cta {
  background: linear-gradient(135deg, #c0c0c0, #8a8a8a);
  color: #1a1a1a;
  box-shadow: 0 4px 20px rgba(192, 192, 192, 0.25);
}

.tier-cta.silver-cta:hover {
  box-shadow: 0 8px 30px rgba(192, 192, 192, 0.4);
  transform: translateY(-2px);
}

.tier-cta.gold-cta {
  background: linear-gradient(135deg, #ffd700, #daa520);
  color: #1a1a1a;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.tier-cta.gold-cta:hover {
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.45);
  transform: translateY(-2px);
}

/* ============================================================
   PAYMENT PAGE STYLES
   ============================================================ */

.payment-page {
  padding-top: var(--topbar-h);
  min-height: 100vh;
  background: radial-gradient(ellipse at top center, rgba(124, 109, 240, 0.04) 0%, transparent 60%);
}

.payment-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.payment-container h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  animation: fadeInUp 0.5s ease-out;
}

.payment-container .subtitle {
  color: var(--text-sec);
  font-size: 14px;
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease-out 0.05s backwards;
}

.payment-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.method-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeInUp 0.5s ease-out backwards;
}

.method-card:nth-child(1) { animation-delay: 0.1s; }
.method-card:nth-child(2) { animation-delay: 0.15s; }
.method-card:nth-child(3) { animation-delay: 0.2s; }
.method-card:nth-child(4) { animation-delay: 0.25s; }

.method-card:hover {
  border-color: rgba(124, 109, 240, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.method-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 12px 40px rgba(124, 109, 240, 0.15);
}

.method-card .method-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(124, 109, 240, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.method-card .method-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

.method-card .method-name {
  font-size: 14px;
  font-weight: 600;
}

.method-card .method-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Blocked / disabled payment method */
.method-card.method-blocked {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.method-card.method-blocked::after {
  content: 'Unavailable';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 13, 0.75);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--danger);
}

/* Steps list for payment flow */
.method-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.method-steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.6;
}

.method-steps li .step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124, 109, 240, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Tooltip */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.tooltip-wrap .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  color: var(--text-sec);
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 50;
}

.tooltip-wrap .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.tooltip-wrap:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ============================================================
   BADGE STYLES (Bronze / Silver / Gold)
   ============================================================ */

.badge-bronze,
.badge-silver,
.badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  position: relative;
  overflow: hidden;
}

.badge-bronze::before,
.badge-silver::before,
.badge-gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

.badge-bronze {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.08));
  color: #cd7f32;
  border: 1px solid rgba(205, 127, 50, 0.25);
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.15);
}

.badge-silver {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.08));
  color: #c0c0c0;
  border: 1px solid rgba(192, 192, 192, 0.25);
  box-shadow: 0 0 12px rgba(192, 192, 192, 0.15);
}

.badge-gold {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.08));
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.2);
}

.badge-level {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(124, 109, 240, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
}

.badge-level::before {
  content: '\2B50';
  font-size: 12px;
}

/* ============================================================
   NOTES SYSTEM STYLES
   ============================================================ */

.notes-page {
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 0;
}

.notes-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

.note-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out backwards;
}

.note-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.note-card:hover {
  border-color: rgba(124, 109, 240, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.note-card:hover::before {
  opacity: 1;
}

.note-card.color-purple::before { background: #7c6df0; }
.note-card.color-blue::before   { background: #3b82f6; }
.note-card.color-green::before  { background: #34d399; }
.note-card.color-orange::before { background: #fbbf24; }
.note-card.color-pink::before   { background: #f472b6; }
.note-card.color-red::before    { background: #f87171; }

.note-card h3 {
  font-size: 15px;
  font-weight: 600;
  padding-left: 8px;
}

.note-card p {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.6;
  padding-left: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card .note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 8px;
  margin-top: auto;
}

.note-editor {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 700px;
  margin: 0 auto;
}

.note-editor .note-title-input {
  width: 100%;
  padding: 12px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  transition: border-color 0.2s;
}

.note-editor .note-title-input:focus {
  border-bottom-color: var(--accent);
}

.note-editor .note-body-input {
  width: 100%;
  min-height: 300px;
  padding: 16px 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
}

.note-editor .note-body-input::placeholder {
  color: var(--text-muted);
}

.note-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.note-editor-toolbar .color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.note-editor-toolbar .color-dot:hover {
  transform: scale(1.15);
}

.note-editor-toolbar .color-dot.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

/* ============================================================
   ENHANCED ANIMATIONS & KEYFRAMES
   ============================================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  50%, 100% {
    left: 100%;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Smooth transitions on interactive elements */
a,
button,
.btn,
.tool-card,
.method-card,
.note-card,
.tier-card,
.chat-room-item,
.profile-dropdown-item,
.panel-nav-item,
input,
textarea,
select {
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   PREMIUM PROFILE BADGE
   ============================================================ */

.profile-badge-wrap {
  position: relative;
  display: inline-flex;
}

.profile-badge-wrap .premium-badge-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 2px solid var(--bg);
  z-index: 2;
  animation: glowPulse 2s ease-in-out infinite;
}

.profile-badge-wrap .premium-badge-icon.bronze {
  background: linear-gradient(135deg, #cd7f32, #a0622a);
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.4);
}

.profile-badge-wrap .premium-badge-icon.silver {
  background: linear-gradient(135deg, #c0c0c0, #8a8a8a);
  box-shadow: 0 0 10px rgba(192, 192, 192, 0.4);
}

.profile-badge-wrap .premium-badge-icon.gold {
  background: linear-gradient(135deg, #ffd700, #daa520);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.profile-badge-wrap .premium-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.profile-badge-wrap .premium-ring.bronze {
  border: 2px solid rgba(205, 127, 50, 0.5);
  box-shadow: 0 0 8px rgba(205, 127, 50, 0.2);
}

.profile-badge-wrap .premium-ring.silver {
  border: 2px solid rgba(192, 192, 192, 0.5);
  box-shadow: 0 0 8px rgba(192, 192, 192, 0.2);
}

.profile-badge-wrap .premium-ring.gold {
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}

/* ============================================================
   LEVEL / XP BAR STYLES
   ============================================================ */

.xp-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.xp-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.xp-bar-header .xp-label {
  font-size: 12px;
  color: var(--text-sec);
  font-weight: 500;
}

.xp-bar-header .xp-value {
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
}

.xp-bar {
  width: 100%;
  height: 10px;
  background: var(--bg-input);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.xp-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  position: relative;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px var(--accent-glow);
}

.xp-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 2.5s ease-in-out infinite;
}

.xp-fill.bronze {
  background: linear-gradient(90deg, #a0622a, #cd7f32, #e8a85c);
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.3);
}

.xp-fill.silver {
  background: linear-gradient(90deg, #8a8a8a, #c0c0c0, #e0e0e0);
  box-shadow: 0 0 12px rgba(192, 192, 192, 0.3);
}

.xp-fill.gold {
  background: linear-gradient(90deg, #daa520, #ffd700, #ffe44d);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.level-badge .level-num {
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.level-badge.bronze {
  border-color: rgba(205, 127, 50, 0.3);
  color: #cd7f32;
}

.level-badge.bronze .level-num {
  background: linear-gradient(135deg, #cd7f32, #e8a85c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.level-badge.silver {
  border-color: rgba(192, 192, 192, 0.3);
  color: #c0c0c0;
}

.level-badge.silver .level-num {
  background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.level-badge.gold {
  border-color: rgba(255, 215, 0, 0.3);
  color: #ffd700;
}

.level-badge.gold .level-num {
  background: linear-gradient(135deg, #ffd700, #ffe44d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   DIAMOND BADGE (Prestige Tier)
   ============================================================ */

.level-badge.diamond {
  border-color: rgba(224, 195, 252, 0.3);
  color: #e0c3fc;
}

.level-badge.diamond .level-num {
  background: linear-gradient(135deg, #e0c3fc, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.premium-badge.diamond {
  background: linear-gradient(135deg, rgba(224,195,252,0.15), rgba(255,215,0,0.1));
  border: 1px solid rgba(224,195,252,0.25);
  color: #e0c3fc;
}

/* ============================================================
   SUPPORT FORM STYLES
   ============================================================ */

.support-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.support-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.support-divider {
  display: inline-block;
  margin: 0 8px;
  color: var(--text-muted);
}

/* ============================================================
   INBOX / TICKET STYLES (Owner Panel)
   ============================================================ */

.inbox-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.inbox-stat-card {
  background: rgba(124,109,240,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}

.inbox-stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.inbox-stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.inbox-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.inbox-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(124,109,240,0.06);
  border: 1px solid var(--border);
  color: var(--text-sec);
  cursor: pointer;
  transition: all 0.2s;
}

.inbox-filter-btn:hover {
  background: rgba(124,109,240,0.12);
  color: var(--text);
}

.inbox-filter-btn.active {
  background: rgba(124,109,240,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   PAGE TOPBAR (Universal)
   ============================================================ */

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 16, 33, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-icon-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   PRIORITY BADGES
   ============================================================ */

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.priority-badge.p5 { background: rgba(52,211,153,0.12); color: #34d399; }
.priority-badge.p4 { background: rgba(163,230,53,0.12); color: #a3e635; }
.priority-badge.p3 { background: rgba(251,191,36,0.12); color: #fbbf24; }
.priority-badge.p2 { background: rgba(251,146,60,0.12); color: #fb923c; }
.priority-badge.p1 { background: rgba(248,113,113,0.12); color: #f87171; }

/* ============================================================
   PRESTIGE / DIAMOND PREMIUM STYLES
   ============================================================ */

.badge-diamond {
  background: linear-gradient(135deg, #e0c3fc, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.xp-bar.diamond {
  background: linear-gradient(90deg, #e0c3fc, #ffd700);
}

/* Diamond profile border */
.profile-pfp-preview.diamond-border {
  border: 3px solid;
  border-image: linear-gradient(135deg, #e0c3fc, #ffd700) 1;
  border-radius: 50%;
}

/* ============================================================
   PREMIUM UPSELL CHIP
   ============================================================ */

.go-premium-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,215,0,0.12), rgba(255,215,0,0.04));
  border: 1px solid rgba(255,215,0,0.2);
  color: #ffd700;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.go-premium-chip:hover {
  background: rgba(255,215,0,0.18);
  transform: scale(1.05);
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
  .inbox-stats { grid-template-columns: repeat(2, 1fr); }
  .inbox-filters { gap: 4px; }
}

/* ═══ CHAT ENHANCEMENTS ═════════════════════════════════ */

/* Reply bar above input */
.chat-reply-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: rgba(124,109,240,0.06);
  border-left: 3px solid var(--accent); border-radius: 4px; margin-bottom: 8px;
}
.chat-reply-bar .reply-preview { display: flex; flex-direction: column; gap: 2px; }
.reply-to-name { font-size: 11px; font-weight: 700; color: var(--accent); }
.reply-to-text { font-size: 12px; color: var(--text-muted); max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-cancel { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-muted); cursor: pointer; font-size: 16px; background: none; border: none; }
.reply-cancel:hover { background: var(--bg-hover); color: var(--text); }

/* Reply reference in message */
.chat-reply-ref {
  padding: 6px 10px; margin-bottom: 6px;
  background: rgba(124,109,240,0.06);
  border-left: 2px solid var(--accent); border-radius: 4px; cursor: pointer;
  font-size: 12px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-reply-ref:hover { background: rgba(124,109,240,0.1); }
.reply-ref-name { font-weight: 700; color: var(--accent); margin-right: 6px; font-size: 11px; }
.reply-ref-text { color: var(--text-muted); }

/* Message hover actions */
.chat-msg-actions {
  display: none; position: absolute; top: -8px; right: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 2px; gap: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4); z-index: 5;
}
.chat-message:hover .chat-msg-actions { display: flex; }
.chat-msg-actions button {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: background 0.15s; background: none; border: none; cursor: pointer; color: var(--text-sec);
}
.chat-msg-actions button:hover { background: var(--bg-hover); color: var(--text); }

/* Edited tag */
.edited-tag { font-size: 10px; color: var(--text-muted); font-style: italic; margin-left: 4px; }

/* Attachments */
.chat-attachment-img {
  max-width: 320px; max-height: 220px;
  border-radius: 8px; margin-top: 6px;
  cursor: pointer; transition: opacity 0.2s; display: block;
}
.chat-attachment-img:hover { opacity: 0.85; }
.chat-attachment-file {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin-top: 6px;
  background: rgba(124,109,240,0.08); border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--accent); text-decoration: none; transition: background 0.2s;
}
.chat-attachment-file:hover { background: rgba(124,109,240,0.15); }

/* Drag and drop overlay */
.chat-messages.drag-over { border: 2px dashed var(--accent); background: rgba(124,109,240,0.04); }

/* @Mention */
.mention { color: var(--accent); font-weight: 600; cursor: pointer; background: rgba(124,109,240,0.1); padding: 1px 4px; border-radius: 4px; }
.mention:hover { text-decoration: underline; }
.mention-dropdown {
  position: absolute; bottom: 100%; left: 60px;
  width: 260px; max-height: 200px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  overflow-y: auto; z-index: 10;
}
.mention-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; transition: background 0.15s; font-size: 13px;
}
.mention-item:hover, .mention-item.selected { background: var(--bg-hover); }

/* ═══ STATUS INDICATORS ═════════════════════════════════ */
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--bg-card);
  display: inline-block; flex-shrink: 0;
}
.status-dot.status-online { background: #34d399; }
.status-dot.status-offline { background: #f87171; }
.status-dot.status-dnd {
  background: #f87171; position: relative;
}
.status-dot.status-dnd::after {
  content: ''; position: absolute;
  top: 50%; left: 15%; right: 15%;
  height: 2px; background: var(--bg-card);
  transform: translateY(-50%);
}
.status-selector { padding: 8px 12px; border-top: 1px solid var(--border); }
.status-selector select {
  width: 100%; padding: 6px 10px; background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 12px; font-family: 'Inter', sans-serif;
}

/* ═══ STREAK BADGE ══════════════════════════════════════ */
.streak-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 12px;
  background: rgba(251,191,36,0.12); color: #fbbf24;
  font-size: 12px; font-weight: 700;
}

/* ═══ POLL UI ═══════════════════════════════════════════ */
.poll-container {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-top: 8px; max-width: 400px;
}
.poll-question { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.poll-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 6px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
  position: relative; overflow: hidden;
}
.poll-option:hover { border-color: var(--accent); }
.poll-option.voted { border-color: var(--accent); background: rgba(124,109,240,0.08); }
.poll-option-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(124,109,240,0.1); transition: width 0.5s ease;
}
.poll-option-text { flex: 1; font-size: 13px; position: relative; z-index: 1; color: var(--text); }
.poll-option-count { font-size: 12px; font-weight: 700; color: var(--text-muted); position: relative; z-index: 1; }
.poll-total { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* Chat input row */
.chat-input-row { display: flex; gap: 8px; align-items: center; }
.chat-action-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-muted); transition: all 0.2s;
  background: none; border: none; cursor: pointer; font-size: 16px; flex-shrink: 0;
}
.chat-action-btn:hover { background: var(--bg-hover); color: var(--text); }
.chat-message { position: relative; }

/* ═══ CALENDAR ══════════════════════════════════════════ */
.calendar-grid { max-width: 500px; }
.cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-header span { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px; text-transform: uppercase; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day { text-align: center; padding: 10px 4px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; user-select: none; }
.cal-day.empty { cursor: default; }
.cal-day.school { background: rgba(52,211,153,0.12); color: #34d399; }
.cal-day.off { background: rgba(248,113,113,0.12); color: #f87171; }
.cal-day.weekend { background: var(--bg-hover); color: var(--text-muted); }
.cal-day:not(.empty):hover { transform: scale(1.1); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

/* ═══ PROFESSIONAL POLISH ═══════════════════════════════ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.home-grid .tool-card { animation: fadeInUp 0.4s ease both; }
.home-grid .tool-card:nth-child(1) { animation-delay: 0.05s; }
.home-grid .tool-card:nth-child(2) { animation-delay: 0.1s; }
.home-grid .tool-card:nth-child(3) { animation-delay: 0.15s; }
.home-grid .tool-card:nth-child(4) { animation-delay: 0.2s; }

/* Quick stats */
.quick-stats-row { display: flex; gap: 16px; padding: 0 0 20px; flex-wrap: wrap; }
.quick-stat { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 120px; transition: border-color 0.2s; }
.quick-stat:hover { border-color: rgba(124,109,240,0.25); }
.quick-stat-icon { font-size: 20px; }
.quick-stat-info { display: flex; flex-direction: column; }
.quick-stat-value { font-size: 18px; font-weight: 700; color: var(--text); }
.quick-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Report items */
.report-item { transition: border-color 0.2s; }
.report-item:hover { border-color: var(--accent) !important; }

/* ═══ BACK NAVIGATION BUTTON ═══════════════════════════ */
.back-nav {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(15,17,28,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(124,109,240,0.15);
  border-radius: 10px;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  text-decoration: none;
}
.back-nav:hover {
  background: rgba(124,109,240,0.12);
  color: var(--accent);
  border-color: rgba(124,109,240,0.3);
  transform: translateX(-2px);
}
.back-nav svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s;
}
.back-nav:hover svg { transform: translateX(-3px); }

/* ═══ OG BADGE ═══════════════════════════════════════════ */
.og-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: ogShine 3s ease infinite;
}
@keyframes ogShine {
  0%, 100% { box-shadow: 0 0 6px rgba(251,191,36,0.3); }
  50% { box-shadow: 0 0 14px rgba(251,191,36,0.6); }
}

/* ═══ CUSTOM CHECKBOXES — Sleek & Modern ═══════════════════ */
input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(124, 109, 240, 0.25);
  border-radius: 6px;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
input[type="checkbox"]:hover {
  border-color: var(--accent);
  background: rgba(124, 109, 240, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 109, 240, 0.08);
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(124, 109, 240, 0.3);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-0.5px, -0.5px);
  animation: checkPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
input[type="checkbox"]:active {
  transform: scale(0.92);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@keyframes checkPop {
  0% { opacity: 0; transform: rotate(45deg) scale(0) translate(-0.5px, -0.5px); }
  60% { transform: rotate(45deg) scale(1.15) translate(-0.5px, -0.5px); }
  100% { opacity: 1; transform: rotate(45deg) scale(1) translate(-0.5px, -0.5px); }
}

/* Toggle switch variant */
.toggle-switch {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 40px !important;
  height: 22px !important;
  border: none !important;
  border-radius: 11px !important;
  background: #2a2a3e !important;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '' !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #6b6b8a !important;
  border: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform: none !important;
}
.toggle-switch:checked {
  background: var(--accent) !important;
  box-shadow: 0 0 12px rgba(124, 109, 240, 0.3) !important;
}
.toggle-switch:checked::after {
  left: 21px !important;
  background: #fff !important;
}
.toggle-switch:hover { box-shadow: 0 0 0 3px rgba(124, 109, 240, 0.1) !important; }

/* ═══ SMOOTH GLOBAL ANIMATIONS ═══════════════════════════ */
@keyframes smoothFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes smoothSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes smoothScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,109,240,0.2); }
  50% { box-shadow: 0 0 20px 4px rgba(124,109,240,0.15); }
}

/* Smooth page transitions */
.page-content { animation: smoothFadeIn 0.35s ease both; }

/* Smooth all interactable elements */
a, button, input, select, textarea, .tool-card, .profile-section {
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ═══ RESPONSIVE DESIGN — ALL DEVICE SIZES ════════════════ */

/* Large tablet / small desktop */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .home-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Tablet */
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; padding: 20px 16px !important; }
  .welcome-greeting { padding: 24px 16px 0 !important; }
  .welcome-greeting h2 { font-size: 24px !important; }
  .topbar { padding: 0 16px !important; }
  .tiers-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .quick-stats-row { gap: 10px; }
  .quick-stat { padding: 10px 14px; min-width: 100px; }

  /* Owner panel sidebar collapses to top bar */
  .panel-layout { flex-direction: column !important; }
  .panel-sidebar {
    width: 100% !important; height: auto !important;
    position: relative !important; border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    max-height: 56px; overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .panel-sidebar.expanded { max-height: 80vh; overflow-y: auto; }
  .panel-sidebar-header { cursor: pointer; }
  .panel-sidebar-header::after { content: '▼'; font-size: 10px; margin-left: auto; color: var(--text-muted); }
  .panel-content { width: 100% !important; padding: 20px 16px !important; }

  /* Chat layout */
  .chat-layout { flex-direction: column; }
}

/* Small tablet / large mobile */
@media (max-width: 768px) {
  .inbox-stats { grid-template-columns: repeat(2, 1fr); }
  .inbox-filters { gap: 4px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stat-card { padding: 14px !important; }
  .stat-card .value { font-size: 22px !important; }

  /* Landing page */
  .landing-hero h1 { font-size: 36px !important; }
  .landing-hero .tagline { font-size: 15px !important; }
  .landing-features { grid-template-columns: 1fr !important; max-width: 400px; }
  .landing-cta { flex-direction: column; width: 100%; max-width: 300px; }
  .landing-cta .btn { width: 100% !important; text-align: center; }

  /* Search/notification panels */
  .notifications-panel, .search-panel { width: 100% !important; right: -100% !important; }
  .notifications-panel.open, .search-panel.open { right: 0 !important; }

  /* Modals */
  .modal { width: 95% !important; max-width: 95% !important; margin: 10px !important; padding: 20px !important; }

  /* Poll */
  .poll-container { max-width: 100% !important; }

  /* Chat messages */
  .chat-attachment-img { max-width: 240px !important; }
  .chat-reply-ref { max-width: 200px !important; }
  .mention-dropdown { width: 200px !important; left: 10px !important; }

  /* Hub toolbar */
  .hub-toolbar { flex-wrap: wrap; gap: 6px !important; padding: 8px !important; }
  .hub-toolbar button { font-size: 11px !important; padding: 6px 10px !important; }

  /* AI layouts */
  .ai-layout { flex-direction: column; }
  .ai-sidebar { width: 100% !important; height: auto !important; max-height: 200px; position: relative !important; }
  .ai-main { width: 100% !important; }
}

/* Mobile */
@media (max-width: 640px) {
  :root { --topbar-h: 52px; }
  .home-grid { grid-template-columns: 1fr !important; gap: 12px !important; padding: 16px 12px !important; }
  .welcome-greeting { padding: 20px 12px 0 !important; }
  .welcome-greeting h2 { font-size: 20px !important; }
  .topbar, .app-topbar { padding: 0 12px !important; }
  .topbar-brand { font-size: 16px !important; gap: 6px !important; }
  .topbar-actions { gap: 4px !important; }
  .topbar-actions .chip { display: none !important; }
  .tool-card { padding: 20px !important; }
  .tool-card h3 { font-size: 16px !important; }
  .profile-section { padding: 20px !important; }
  .tiers-grid { grid-template-columns: 1fr !important; }
  .chat-sidebar { width: 100% !important; position: absolute; z-index: 10; }
  .chat-main { width: 100% !important; }
  .chat-input-area { padding: 8px !important; }
  .back-nav { top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); }
  .back-nav:hover { transform: translateX(-50%) scale(1.05); }
  .upsell-banner { margin: 0 12px 16px !important; flex-direction: column; text-align: center; gap: 12px !important; }

  /* Premium page */
  .premium-hero { padding: 60px 16px 40px !important; min-height: 320px !important; }
  .premium-hero h1 { font-size: 28px !important; }
  .premium-content { padding: 32px 12px 48px !important; }

  /* Notes */
  .notes-grid { grid-template-columns: 1fr !important; }

  /* Support */
  .support-content { padding: 16px !important; }

  /* Stat grid single col on narrow */
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }

  /* Profile dropdown */
  .profile-dropdown { right: -8px !important; min-width: 200px !important; }

  /* Quick stats */
  .quick-stats-row { flex-direction: column; gap: 8px; }
  .quick-stat { min-width: 0; width: 100%; }

  /* Calendar smaller cells */
  .cal-day { padding: 8px 2px !important; font-size: 12px !important; }
  .calendar-grid { max-width: 100% !important; }

  /* Data tables horizontal scroll */
  .data-table { font-size: 12px !important; }
  .data-table th, .data-table td { padding: 8px 10px !important; white-space: nowrap; }

  /* Ticket rows stack */
  .ticket-row { flex-wrap: wrap; gap: 8px !important; padding: 10px 12px !important; }
  .ticket-row .ticket-sender { min-width: 80px !important; max-width: 100px !important; }
  .ticket-row .ticket-body { min-width: 0; flex-basis: 100%; }
}

/* Small mobile */
@media (max-width: 380px) {
  .home-grid { padding: 12px 8px !important; }
  .welcome-greeting { padding: 16px 8px 0 !important; }
  .welcome-greeting h2 { font-size: 18px !important; }
  .tool-card { padding: 16px !important; }
  .premium-hero h1 { font-size: 22px !important; }
  .stat-grid { grid-template-columns: 1fr !important; }
  .landing-hero h1 { font-size: 28px !important; }
  .auth-card { padding: 28px 20px !important; }
  .form-input { padding: 10px 12px !important; }
  .btn { padding: 10px 16px !important; font-size: 13px !important; }
  .icon-btn { width: 34px !important; height: 34px !important; }
  .profile-btn { width: 32px !important; height: 32px !important; }
}

/* Very small (folding phones, narrow widgets) */
@media (max-width: 320px) {
  .app-topbar { padding: 0 8px !important; }
  .topbar-brand { font-size: 14px !important; }
  .home-grid { padding: 8px 6px !important; gap: 8px !important; }
  .tool-card { padding: 14px !important; }
  .tool-card-icon { width: 36px !important; height: 36px !important; }
  .tool-card h3 { font-size: 14px !important; }
  .tool-card p { font-size: 11px !important; }
}
