/* ═══════════════════════════════════════════════
   Piano-OS — Dark Forest Brand Theme
   Pink Piano Café brand colors: deep green + pink
   Body font: Space Grotesk
   ═══════════════════════════════════════════════ */

:root {
  /* ─── Original Dark Theme ──────────────────── */
  --bg: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-input: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);

  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-secondary: rgba(255, 255, 255, 0.7);

  --pink: #ff69b4;
  --pink-dark: #ff1493;
  --pink-glow: rgba(255, 105, 180, 0.3);
  --pink-soft: #ff69b4;

  --green: #2D6A4F;
  --green-light: #40916C;
  --green-dark: #1B4332;
  --green-glow: rgba(45, 106, 79, 0.3);

  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 24px;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Animated Background ──────────────────── */

.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(255, 105, 180, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(138, 43, 226, 0.15) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

#particles {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--pink-soft); }

/* ─── Navigation ───────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: rgba(10, 10, 15, 0.7);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-img {
  height: 32px;
  width: 32px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-link.active { color: var(--pink); background: rgba(255, 105, 180, 0.1); }
.nav-logout { color: var(--text-muted); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-name {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ─── Layout ───────────────────────────────── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.main-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 60px);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
}

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

/* ─── Cards ────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(40px);
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

/* ─── Stats Grid ───────────────────────────── */

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--pink);
  box-shadow: 0 8px 32px var(--pink-glow);
  transform: translateY(-2px);
}

.stat-icon { font-size: 32px; margin-bottom: 8px; }
.stat-value { font-size: 36px; font-weight: 700; color: var(--pink); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ─── Dashboard Grid ──────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

/* ─── Buttons ──────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: white;
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 4px 16px var(--pink-glow); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

.btn-full { width: 100%; }
.btn-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.15); }

.btn-link {
  background: none; border: none; color: var(--pink);
  font-family: inherit; font-size: 14px; cursor: pointer;
  padding: 0; text-decoration: none;
}
.btn-link:hover { color: var(--pink-soft); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Forms ────────────────────────────────── */

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input, textarea, select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

.input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

textarea { resize: vertical; }
select { cursor: pointer; }
select option { background: var(--bg); color: var(--text); }

/* ─── Alerts & Badges ─────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}

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

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-confirmed, .badge-replied, .badge-completed { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.badge-unread, .badge-warning, .badge-scheduled { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-cancelled, .badge-no_show { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.badge-sold_out { background: rgba(255, 105, 180, 0.15); color: var(--pink); }
.badge-draft, .badge-read, .badge-archived { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.badge-sent { background: rgba(96, 165, 250, 0.15); color: var(--info); }

/* ─── Login Page ───────────────────────────── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-container { width: 100%; max-width: 420px; padding: 24px; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  backdrop-filter: blur(40px);
}

.login-logo {
  width: 220px;
  height: auto;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Fallback for emoji logo (original theme) */
.login-logo:not(:has(img)) {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  border-radius: 50%;
  font-size: 36px;
  box-shadow: 0 12px 40px var(--pink-glow);
}

.login-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

.login-form { margin-top: 24px; }
.login-links { text-align: center; margin-top: 16px; }

/* ─── Recovery Codes ──────────────────────── */

.recovery-codes {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0;
}
.recovery-codes code {
  background: var(--bg-input);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 13px;
}

/* ─── Email ────────────────────────────────── */

.email-filters {
  margin-bottom: 24px;
}

.filter-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-form .input { flex: 1; }
.filter-form select { width: 160px; }

.email-list { display: flex; flex-direction: column; gap: 2px; }

.email-row {
  display: grid;
  grid-template-columns: 28px 8px 160px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.email-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.email-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pink);
  cursor: pointer;
}

.email-row-link {
  display: contents;
  color: var(--text);
  text-decoration: none;
}

.email-unread { font-weight: 600; }
.email-unread .email-subject strong { color: var(--text); }

.email-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.status-unread { background: var(--pink); }
.status-read { background: var(--text-muted); }
.status-replied { background: var(--success); }
.status-archived { background: transparent; }
.status-sent { background: var(--info); }

.email-from {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-subject {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-snippet { color: var(--text-muted); font-weight: 400; }

.email-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.email-date { color: var(--text-muted); }
.email-attachment { font-size: 14px; }

/* Email Select All */
.email-select-all {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  margin-bottom: 4px;
}

.email-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.email-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pink);
  cursor: pointer;
}

/* Floating Bulk Action Bar */
.email-bulk-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 100;
  transition: bottom 0.3s ease;
  white-space: nowrap;
}

.email-bulk-bar.visible {
  bottom: 24px;
}

.email-bulk-bar span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.bulk-deselect {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  margin-left: 4px;
}

.bulk-deselect:hover { color: var(--text); }

.email-account-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 105, 180, 0.15);
  color: var(--pink);
  white-space: nowrap;
}

/* Email Detail */

.email-detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  max-width: 100%;
  overflow: hidden;
}
.email-detail-card { min-width: 0; }

.email-detail-header { margin-bottom: 24px; }
.email-detail-header h1 { font-size: 22px; margin-bottom: 12px; }
.email-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.email-detail-meta strong { color: var(--text-secondary); }

.email-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding: 20px 0;
  border-top: 1px solid var(--border);
  word-wrap: break-word;
  overflow-x: auto;
}
.email-body img { max-width: 100%; height: auto; }
.email-body table { max-width: 100%; }

/* ─── Attachments ─────────────────────── */
.email-attachments {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.email-attachments h4 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}
.attachment-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--pink);
  color: var(--text);
}
.attachment-icon { font-size: 18px; }
.attachment-name { font-weight: 500; }
.attachment-size { color: var(--text-muted); font-size: 12px; }

.attachment-upload-label { cursor: pointer; }
.attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.attachment-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.email-sidebar { display: flex; flex-direction: column; gap: 16px; }

.action-buttons { display: flex; flex-direction: column; gap: 8px; }
.action-buttons-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { opacity: 0.85; }
.badge-success { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.badge-muted { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }
.setup-steps { padding-left: 20px; line-height: 2; }
.setup-steps code { background: var(--bg-input); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

.email-thread { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 20px; }
.email-thread h3 { margin-bottom: 16px; font-size: 16px; }

.thread-message {
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s;
}
.thread-message:hover { background: rgba(255, 255, 255, 0.05); }
.thread-current { border-left: 3px solid var(--pink); }
.thread-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.thread-snippet { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-chevron { font-size: 12px; color: var(--text-muted); transition: transform 0.15s; }
.thread-full-body { font-size: 14px; line-height: 1.7; color: var(--text-secondary); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); overflow-x: auto; }
.thread-full-body img { max-width: 100%; height: auto; }
.thread-full-body table { max-width: 100%; }

.history-list { display: flex; flex-direction: column; gap: 4px; }
.history-item {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 0; font-size: 13px;
  color: var(--text-secondary); text-decoration: none;
}
.history-item:hover { color: var(--pink); }
.history-direction { width: 16px; text-align: center; }
.history-subject { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Events ───────────────────────────────── */

.event-list { display: flex; flex-direction: column; gap: 8px; }

.event-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.event-item:last-child { border-bottom: none; }

.event-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--pink);
  min-width: 50px;
}

.event-info { flex: 1; }
.event-title { font-weight: 500; font-size: 14px; }
.event-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; }
.event-type { color: var(--text-muted); text-transform: capitalize; }

.event-date-badge {
  text-align: center;
  min-width: 48px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.event-date-day { font-size: 11px; text-transform: uppercase; color: var(--text-muted); }
.event-date-num { font-size: 20px; font-weight: 700; color: var(--pink); }
.event-date-month { font-size: 11px; color: var(--text-muted); }

.event-card { margin-bottom: 12px; }
.event-card-header { display: flex; gap: 16px; align-items: flex-start; }

/* ─── Shifts ───────────────────────────────── */

.shift-list { display: flex; flex-direction: column; gap: 8px; }
.shift-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.shift-time { font-weight: 500; font-size: 14px; }
.shift-info { display: flex; gap: 8px; align-items: center; }
.shift-position { color: var(--text-muted); font-size: 13px; text-transform: capitalize; }

/* ─── Quick Actions ────────────────────────── */

.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.quick-action-btn {
  display: block;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.quick-action-btn:hover {
  background: rgba(255, 105, 180, 0.08);
  border-color: var(--pink);
  color: var(--pink);
}

/* ─── Chat ─────────────────────────────────── */

.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 60px);
}

.chat-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.01);
}

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

.channel-list { flex: 1; overflow-y: auto; padding: 8px; }

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}
.channel-item:hover { background: rgba(255, 255, 255, 0.05); }
.channel-item.active { background: rgba(255, 105, 180, 0.1); color: var(--pink); }

.channel-icon { width: 20px; text-align: center; color: var(--text-muted); }
.channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-badge {
  background: var(--pink);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.channel-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 16px 12px 4px;
}

.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s;
  user-select: none;
  flex-shrink: 0;
}
.channel-item:hover .drag-handle { opacity: 0.6; }
.channel-item.dragging { opacity: 0.4; background: rgba(255, 105, 180, 0.1); }

.chat-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.chat-sidebar-footer h3 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

.team-list { display: flex; flex-direction: column; gap: 2px; }
.team-member {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px;
}
.team-member:hover { background: rgba(255, 255, 255, 0.05); }

.presence-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.presence-dot.online { background: var(--success); }
.presence-dot.offline { background: var(--text-muted); opacity: 0.4; }

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-header h2 { font-size: 16px; }
.chat-sidebar-toggle { display: none; font-size: 20px; }

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

.chat-message {
  max-width: 70%;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) var(--radius) 4px;
}
.chat-message.own {
  align-self: flex-end;
  background: rgba(255, 105, 180, 0.08);
  border-color: rgba(255, 105, 180, 0.2);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
}

.message-header {
  display: flex;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}
.message-header strong { font-size: 13px; }

.msg-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  margin-left: auto;
}
.chat-message:hover .msg-delete-btn { opacity: 1; }
.msg-delete-btn:hover { color: var(--danger); }

.message-content { font-size: 14px; line-height: 1.5; word-wrap: break-word; }

.chat-input-area { padding: 12px 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.chat-typing { font-size: 12px; color: var(--text-muted); height: 18px; }

.chat-form { display: flex; gap: 8px; align-items: center; }
.chat-form .input { flex: 1; }

/* Hide bug FAB on chat page */
body.page-chat .bug-fab { display: none; }

.chat-input-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  transition: color 0.2s, border-color 0.2s;
}
.chat-input-btn:hover { color: var(--pink); border-color: var(--pink); }

.chat-attachment { margin-top: 6px; }
.chat-attachment-thumb {
  max-width: 180px;
  max-height: 120px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  object-fit: cover;
  transition: opacity 0.2s;
}
.chat-attachment-thumb:hover { opacity: 0.8; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 16px;
}
.lightbox.open { display: flex; }
.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
}
.lightbox-download {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: underline;
}

.chat-gif {
  max-width: 250px;
  max-height: 200px;
  border-radius: var(--radius-sm);
}

.chat-input-btn.gif-btn { font-size: 11px; font-weight: 700; }

.gif-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 8px;
  margin-bottom: 8px;
}
.gif-picker .input { margin-bottom: 8px; }
.gif-results {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.gif-result-item {
  height: 80px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.gif-result-item:hover { opacity: 0.7; }

/* ─── @Mention Autocomplete ─────────────────── */

.mention-dropdown {
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 4px;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}
.mention-item:hover, .mention-item.active {
  background: rgba(255, 105, 180, 0.1);
  color: var(--pink);
}

.mention-at {
  color: var(--pink);
  font-weight: 600;
}

.mention {
  color: var(--pink);
  font-weight: 500;
  background: rgba(255, 105, 180, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
}

.chat-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.chat-attachment-file:hover { background: rgba(255, 255, 255, 0.08); }

/* ─── Table ───────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ─── Badge Variants ─────────────────────── */

.badge-pink { background: rgba(255, 105, 180, 0.15); color: var(--pink); }
.badge-info { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge-success { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.badge-danger { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.badge-default { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.badge-muted { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); font-size: 10px; }
.badge-handled { background: rgba(74, 222, 128, 0.15); color: var(--success); font-size: 10px; }
.badge-label { background: rgba(45, 106, 79, 0.2); color: var(--accent); font-size: 10px; }

/* ─── Email Labels / Tags ────────────────── */

.email-labels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.email-label-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(45, 106, 79, 0.2);
  color: var(--accent);
}

.email-label-tag .label-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}
.email-label-tag .label-remove:hover { opacity: 1; }

.btn-success {
  background: var(--success);
  color: #000;
  border: none;
}
.btn-success:hover {
  background: #22c55e;
  color: #000;
}

/* ─── Triage UI ───────────────────────────── */

.triage-progress-bar {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.triage-progress-inner {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.triage-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--pink-dark));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.triage-bulk-bar {
  margin-bottom: 16px;
  padding: 10px 16px;
  background: rgba(255, 105, 180, 0.06);
  border: 1px solid rgba(255, 105, 180, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.triage-bulk-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pink);
}

.triage-bulk-bar .btn { margin: 2px 0; }
.triage-cat { text-transform: capitalize; font-size: 10px; }

/* ─── Triage Review Modal ────────────────── */
.triage-review-modal { max-width: 640px; }
.triage-review-body { padding: 0 !important; }
.triage-review-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #111D16; z-index: 1;
}
.triage-review-controls label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.triage-review-list { max-height: 400px; overflow-y: auto; }
.triage-review-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 24px; border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; transition: background 0.15s;
}
.triage-review-item:hover { background: var(--bg-card-hover, rgba(255,255,255,0.03)); }
.triage-review-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.triage-review-item-from { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.triage-review-item-count { font-size: 12px; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 10px; }
.triage-review-item-subject { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.triage-review-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); }

/* ─── AI Reassurance ────────────────────── */
.ai-reassurance {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin: -8px 0 12px 0;
  padding: 0;
  opacity: 0.7;
}

/* ─── Sync Error Banner ──────────────────── */
.sync-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
}
.sync-error-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.sync-error-text { line-height: 1.5; }
.sync-error-link {
  color: var(--pink);
  font-weight: 600;
  text-decoration: underline;
  margin-left: 4px;
}
.sync-error-link:hover { color: #ff8cc8; }

/* ─── Priority Groups (Smart Inbox) ─────── */
.email-group { margin-bottom: 8px; }
.email-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-secondary); border-bottom: 1px solid var(--border);
  text-decoration: none; cursor: pointer; transition: background 0.15s;
}
.email-group-header:hover { background: rgba(255, 255, 255, 0.03); }
.email-group-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-urgent { background: var(--danger, #f87171); box-shadow: 0 0 8px rgba(248, 113, 113, 0.4); }
.dot-soon { background: var(--warning, #fbbf24); box-shadow: 0 0 8px rgba(251, 191, 36, 0.3); }
.dot-low { background: var(--success, #4ade80); box-shadow: 0 0 8px rgba(74, 222, 128, 0.3); }
.dot-bills { background: #60a5fa; box-shadow: 0 0 8px rgba(96, 165, 250, 0.3); }
.email-group-urgent { color: var(--danger, #f87171); }
.email-group-soon { color: var(--warning, #fbbf24); }
.email-group-bills { color: #60a5fa; }
.email-group-low { color: var(--success, #4ade80); }
.email-group-count {
  font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06); color: var(--text-muted);
  text-transform: none; letter-spacing: 0;
}

/* Priority Filter Pills */
.priority-filter-bar {
  display: flex; gap: 6px; padding: 8px 16px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.priority-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 500;
  color: var(--text-secondary); background: rgba(255, 255, 255, 0.04);
  text-decoration: none; transition: background 0.15s, color 0.15s; cursor: pointer;
}
.priority-pill:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.priority-pill.active { background: rgba(255, 255, 255, 0.1); color: var(--text); font-weight: 600; }
.priority-pill .email-group-dot { width: 8px; height: 8px; }
.priority-pill-count {
  font-size: 10px; padding: 0 5px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.08); min-width: 16px; text-align: center;
}

/* Priority Badge on email rows */
.priority-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.priority-high { background: rgba(248, 113, 113, 0.15); color: var(--danger, #f87171); }
.priority-med { background: rgba(251, 191, 36, 0.15); color: var(--warning, #fbbf24); }
.priority-low { background: rgba(74, 222, 128, 0.12); color: var(--success, #4ade80); }

/* ─── Celebration Modal ──────────────────── */
.celebration-modal { max-width: 440px; text-align: center; border: 1px solid rgba(255, 105, 180, 0.2); overflow: visible; }
.celebration-content { padding: 40px 32px; }
.celebration-icon { font-size: 64px; line-height: 1; margin-bottom: 16px; }
.celebration-bounce { animation: celebrationBounce 0.6s ease; }
@keyframes celebrationBounce {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}
.celebration-content h2 {
  font-size: 24px; font-weight: 700; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--pink, #ff69b4), #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.celebration-stats { display: flex; justify-content: center; gap: 24px; margin: 24px 0; }
.celebration-stat { display: flex; flex-direction: column; align-items: center; }
.celebration-stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.celebration-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.celebration-content .btn-pink { margin-top: 8px; padding: 10px 32px; font-size: 15px; }

.btn-pink {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: white;
  border: none;
}
.btn-pink:hover { opacity: 0.9; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ─── Empty State ──────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

/* ─── Bug Report FAB & Modal ──────────────── */

.bug-fab {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 20px var(--pink-glow);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bug-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(255, 105, 180, 0.5);
}

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

.bug-modal {
  background: #111D16;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  margin: 24px;
  overflow: hidden;
}

.bug-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.bug-modal-header h2 { font-size: 18px; font-weight: 600; }

.bug-modal-body {
  padding: 24px;
}

.bug-priority-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bug-priority-option {
  cursor: pointer;
}
.bug-priority-option input { display: none; }

.bug-priority-chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.bug-priority-chip.feature { color: var(--info); }
.bug-priority-chip.medium { color: var(--warning); }
.bug-priority-chip.critical { color: var(--danger); }

.bug-priority-option input:checked + .bug-priority-chip.feature {
  background: rgba(96, 165, 250, 0.15);
  border-color: var(--info);
}
.bug-priority-option input:checked + .bug-priority-chip.medium {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--warning);
}
.bug-priority-option input:checked + .bug-priority-chip.critical {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--danger);
}

.bug-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.bug-success {
  padding: 40px 24px;
  text-align: center;
}
.bug-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: rgba(74, 222, 128, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--success);
}
.bug-success p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ─── PWA Install Banner ───────────────────── */

.pwa-install-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--pink);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(255, 105, 180, 0.15);
  font-size: 14px;
}
.pwa-install-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ─── Utilities ────────────────────────────── */

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

/* ─── Theme Pill Toggle ───────────────────── */

.theme-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 54px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.theme-pill input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.theme-pill-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.theme-pill-track::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Moon icon (dark mode — default, visible on right) */
.theme-pill-track::after {
  content: '\1F319';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  transition: opacity 0.3s;
}

/* Sun icon (light mode — visible on left when checked) */
.theme-pill-sun {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
  pointer-events: none;
}

/* Checked = light mode */
.theme-pill input:checked + .theme-pill-track {
  background: linear-gradient(135deg, #F472B6, #EC4899);
  border-color: rgba(244, 114, 182, 0.5);
}

.theme-pill input:checked + .theme-pill-track::before {
  transform: translateX(26px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-pill input:checked + .theme-pill-track::after {
  opacity: 0;
}

.theme-pill input:checked ~ .theme-pill-sun {
  opacity: 1;
}

.theme-pill:hover .theme-pill-track {
  border-color: var(--pink);
}

.theme-pill-float {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
}

/* ─── Theme Transition Helper ─────────────── */

html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.3s ease, color 0.3s ease,
              border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ═══════════════════════════════════════════════
   Light Mode Theme — Pink Piano Café Brand
   ═══════════════════════════════════════════════ */

.light-mode {
  /* ─── Brand Light Mode Variables ──────────── */
  --bg-primary: #FDF0F7;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #FFF5FB;
  --text-primary: #1A1A1A;
  --accent-primary: #F472B6;
  --accent-deep: #EC4899;
  --accent-green: #2D6A4F;
  --accent-green-light: #3D8B5E;
  --border-color: #F9C8E4;
  --border-strong: #F472B6;
  --shadow: rgba(244, 114, 182, 0.15);
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #2D6A4F;
  --sidebar-active: #FDF0F7;
  --sidebar-active-text: #EC4899;
  --nav-bg: #FFFFFF;
  --badge-bg: #F472B6;
  --badge-text: #FFFFFF;

  /* ─── Override Existing Variables ──────────── */
  --bg: #FDF0F7;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFF5FB;
  --bg-input: #FFFFFF;
  --border: #F9C8E4;
  --border-hover: #F472B6;
  --text: #1A1A1A;
  --text-muted: #888888;
  --text-secondary: #4A4A4A;
  --pink: #F472B6;
  --pink-dark: #EC4899;
  --pink-glow: rgba(244, 114, 182, 0.15);
  --pink-soft: #EC4899;
  --green: #2D6A4F;
  --green-light: #3D8B5E;
  --green-dark: #1B4332;
  --green-glow: rgba(45, 106, 79, 0.1);
  --success: #15803D;
  --warning: #B45309;
  --danger: #DC2626;
  --info: #1D4ED8;
}

/* ─── Background Effects ──────────────────── */

.light-mode .bg-gradient {
  background: radial-gradient(circle at 20% 50%, rgba(244, 114, 182, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(45, 106, 79, 0.04) 0%, transparent 50%);
}

.light-mode #particles {
  opacity: 0.6;
}

/* ─── Navigation ──────────────────────────── */

.light-mode .nav {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--border);
}

.light-mode .nav-link {
  color: var(--accent-green);
}

.light-mode .nav-link:hover {
  color: var(--green);
  background: #FDF0F7;
}

.light-mode .nav-link.active {
  color: var(--accent-deep);
  background: rgba(244, 114, 182, 0.1);
}

.light-mode .nav-logout {
  color: var(--text-muted);
}

.light-mode .nav-user-name {
  color: var(--text-secondary);
}

/* ─── Section Headings ────────────────────── */

.light-mode .page-header h1 {
  color: var(--green);
}

.light-mode .card-title {
  color: var(--green);
}

/* ─── Cards & Panels ─────────────────────── */

.light-mode .card {
  background: #FFFFFF;
  border-color: var(--border);
  backdrop-filter: none;
  box-shadow: 0 2px 12px var(--shadow);
}

.light-mode .stat-card {
  background: #FFFFFF;
  backdrop-filter: none;
  box-shadow: 0 2px 12px var(--shadow);
}

.light-mode .stat-card:hover {
  background: #FFF5FB;
  border-color: var(--pink);
  box-shadow: 0 8px 32px rgba(244, 114, 182, 0.2);
}

/* ─── Buttons ─────────────────────────────── */

.light-mode .btn-primary {
  background: linear-gradient(135deg, #F472B6, #EC4899);
  color: #FFFFFF;
}

.light-mode .btn-primary:hover {
  box-shadow: 0 4px 16px rgba(244, 114, 182, 0.3);
}

.light-mode .btn-secondary {
  background: #FFFFFF;
  color: var(--pink);
  border: 1px solid var(--pink);
}

.light-mode .btn-secondary:hover {
  background: #FDF0F7;
  color: var(--pink-dark);
}

.light-mode .btn-icon {
  background: #FFF5FB;
  border-color: var(--border);
  color: var(--text-secondary);
}

.light-mode .btn-icon:hover {
  background: #FDF0F7;
  color: var(--pink);
}

/* ─── Forms & Inputs ─────────────────────── */

.light-mode .input,
.light-mode textarea,
.light-mode select {
  background: #FFFFFF;
  border-color: var(--border);
  color: var(--text);
}

.light-mode .input:focus,
.light-mode textarea:focus,
.light-mode select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.15);
}

.light-mode .input::placeholder,
.light-mode textarea::placeholder {
  color: #AAAAAA;
}

.light-mode select option {
  background: #FFFFFF;
  color: var(--text);
}

/* ─── Login Page ──────────────────────────── */

.light-mode .login-page {
  background: var(--bg);
}

.light-mode .login-card {
  background: #FFFFFF;
  border-color: var(--border);
  backdrop-filter: none;
  box-shadow: 0 8px 40px rgba(244, 114, 182, 0.12);
}

.light-mode .login-logo:not(:has(img)) {
  background: linear-gradient(135deg, #F472B6, #EC4899);
  box-shadow: 0 12px 40px rgba(244, 114, 182, 0.2);
}

.light-mode .login-form input {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.2s;
}

.light-mode .login-form input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.15);
  outline: none;
}

.light-mode .login-form input::placeholder {
  color: #AAAAAA;
}

/* ─── Alerts ──────────────────────────────── */

.light-mode .alert-error {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ─── Badges & Status ─────────────────────── */

.light-mode .badge-confirmed,
.light-mode .badge-replied,
.light-mode .badge-completed {
  background: rgba(21, 128, 61, 0.1);
}

.light-mode .badge-unread,
.light-mode .badge-warning,
.light-mode .badge-scheduled {
  background: rgba(180, 83, 9, 0.1);
}

.light-mode .badge-cancelled,
.light-mode .badge-no_show {
  background: rgba(220, 38, 38, 0.1);
}

.light-mode .badge-sold_out {
  background: rgba(244, 114, 182, 0.1);
}

.light-mode .badge-draft,
.light-mode .badge-read,
.light-mode .badge-archived {
  background: rgba(136, 136, 136, 0.1);
}

.light-mode .badge-sent {
  background: rgba(29, 78, 216, 0.1);
}

.light-mode .badge-pink {
  background: rgba(244, 114, 182, 0.1);
}

.light-mode .badge-info {
  background: rgba(29, 78, 216, 0.1);
}

.light-mode .badge-success {
  background: rgba(21, 128, 61, 0.1);
}

.light-mode .badge-danger {
  background: rgba(220, 38, 38, 0.1);
}

.light-mode .badge-default {
  background: rgba(136, 136, 136, 0.1);
}

/* ─── Email ───────────────────────────────── */

.light-mode .email-row {
  background: #FFFFFF;
}

.light-mode .email-row:hover {
  background: #FFF5FB;
  border-color: var(--border);
}

.light-mode .email-unread .email-subject strong {
  color: var(--text);
}

.light-mode .email-account-badge {
  background: rgba(45, 106, 79, 0.12);
  color: var(--green);
}

.light-mode .email-bulk-bar {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ─── Email Detail ────────────────────────── */

.light-mode .thread-message {
  background: #FFF5FB;
}

.light-mode .badge-success { background: rgba(45, 106, 79, 0.1); color: var(--green); }
.light-mode .badge-muted { background: rgba(0, 0, 0, 0.06); }
.light-mode .badge-handled { background: rgba(22, 163, 74, 0.12); }
.light-mode .badge-label { background: rgba(45, 106, 79, 0.12); }
.light-mode .email-label-tag { background: rgba(45, 106, 79, 0.12); }
.light-mode .btn-danger { background: #dc3545; }
.light-mode .attachment-item {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}
.light-mode .attachment-item:hover {
  background: rgba(0, 0, 0, 0.06);
}
.light-mode .attachment-tag {
  background: rgba(0, 0, 0, 0.06);
}

/* ─── Events ──────────────────────────────── */

.light-mode .event-item {
  border-bottom-color: var(--border);
}

.light-mode .event-date-badge {
  background: #FFFFFF;
  border-color: var(--border);
}

/* ─── Quick Actions ───────────────────────── */

.light-mode .quick-action-btn {
  background: #FFFFFF;
  border-color: var(--border);
}

.light-mode .quick-action-btn:hover {
  background: #FDF0F7;
  border-color: var(--pink);
}

/* ─── Chat ────────────────────────────────── */

.light-mode .chat-sidebar {
  background: var(--sidebar-bg);
  border-right-color: var(--border);
}

.light-mode .chat-sidebar-header {
  border-bottom-color: var(--border);
}

.light-mode .chat-sidebar-header h2 {
  color: var(--green);
}

.light-mode .chat-header h2 {
  color: var(--green);
}

.light-mode .channel-item {
  color: var(--sidebar-text);
}

.light-mode .channel-item:hover {
  background: var(--sidebar-active);
}

.light-mode .channel-item.active {
  background: rgba(244, 114, 182, 0.1);
  color: var(--sidebar-active-text);
}

.light-mode .channel-badge {
  background: var(--badge-bg);
  color: var(--badge-text);
}

.light-mode .chat-sidebar-footer {
  border-top-color: var(--border);
}

.light-mode .team-member:hover {
  background: #FDF0F7;
}

.light-mode .chat-header {
  border-bottom-color: var(--border);
}

.light-mode .chat-message {
  background: #FFFFFF;
  border-color: var(--border);
}

.light-mode .chat-message.own {
  background: rgba(244, 114, 182, 0.06);
  border-color: rgba(244, 114, 182, 0.2);
}

.light-mode .chat-input-area {
  border-top-color: var(--border);
}

.light-mode .mention-dropdown {
  background: #FFFFFF;
  border-color: var(--border);
}

.light-mode .mention-item:hover,
.light-mode .mention-item.active {
  background: #FDF0F7;
}

.light-mode .mention {
  background: rgba(244, 114, 182, 0.1);
}

.light-mode .chat-attachment-file {
  background: #FFF5FB;
  border-color: var(--border);
}

.light-mode .chat-attachment-file:hover {
  background: #FDF0F7;
}

.light-mode .gif-picker {
  background: #FFFFFF;
  border-color: var(--border);
}

/* ─── Table ───────────────────────────────── */

.light-mode .table td {
  border-bottom-color: var(--border);
}

.light-mode .table tr:hover td {
  background: #FFF5FB;
}

/* ─── Bug Report ──────────────────────────── */

.light-mode .bug-fab {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  box-shadow: 0 4px 20px rgba(244, 114, 182, 0.3);
}

.light-mode .bug-fab:hover {
  box-shadow: 0 6px 28px rgba(244, 114, 182, 0.5);
}

.light-mode .bug-modal {
  background: #FFFFFF;
}

.light-mode .bug-modal-header {
  border-bottom-color: var(--border);
}

.light-mode .bug-modal-overlay {
  background: rgba(0, 0, 0, 0.3);
}

.light-mode .triage-review-controls { background: #FFFFFF; }
.light-mode .triage-review-item { border-bottom-color: rgba(0,0,0,0.06); }
.light-mode .triage-review-item:hover { background: rgba(0,0,0,0.03); }
.light-mode .priority-pill { background: rgba(0, 0, 0, 0.04); }
.light-mode .priority-pill:hover { background: rgba(0, 0, 0, 0.08); }
.light-mode .priority-pill.active { background: rgba(0, 0, 0, 0.1); }
.light-mode .priority-pill-count { background: rgba(0, 0, 0, 0.06); }
.light-mode .email-group-header { border-bottom-color: rgba(0, 0, 0, 0.08); }
.light-mode .email-group-count { background: rgba(0, 0, 0, 0.06); }
.light-mode .priority-high { background: rgba(220, 38, 38, 0.1); color: #DC2626; }
.light-mode .priority-med { background: rgba(217, 119, 6, 0.1); color: #D97706; }
.light-mode .priority-low { background: rgba(22, 163, 74, 0.1); color: #16A34A; }
.light-mode .celebration-modal { border-color: rgba(255, 105, 180, 0.15); background: #FFFFFF; }
.light-mode .sync-error-banner { background: rgba(220, 38, 38, 0.06); border-color: rgba(220, 38, 38, 0.2); }

.light-mode .bug-priority-option input:checked + .bug-priority-chip.feature {
  background: rgba(29, 78, 216, 0.1);
  border-color: var(--info);
}

.light-mode .bug-priority-option input:checked + .bug-priority-chip.medium {
  background: rgba(180, 83, 9, 0.1);
  border-color: var(--warning);
}

.light-mode .bug-priority-option input:checked + .bug-priority-chip.critical {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--danger);
}

/* ─── Recovery Codes ──────────────────────── */

.light-mode .recovery-codes code {
  background: #FFF5FB;
}

/* ─── Lightbox ────────────────────────────── */

.light-mode .lightbox {
  background: rgba(0, 0, 0, 0.7);
}

/* ─── PWA Install Banner ──────────────────── */

.light-mode .pwa-install-banner {
  background: #FFFFFF;
  border-color: var(--pink);
  box-shadow: 0 8px 32px rgba(244, 114, 182, 0.15);
}

/* ─── Hamburger & Mobile Menu ─────────────── */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
/* Animate to X when open */
.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  overflow-y: auto;
  backdrop-filter: blur(20px);
}
.mobile-menu.open {
  display: flex;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-link {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.mobile-menu-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.mobile-menu-link.active {
  background: rgba(255, 105, 180, 0.1);
  color: var(--pink);
}

.mobile-menu-footer {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu-user {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Light mode overrides */
.light-mode .mobile-menu {
  background: rgba(255, 255, 255, 0.97);
}
.light-mode .mobile-menu-link:hover {
  background: rgba(45, 106, 79, 0.06);
}
.light-mode .mobile-menu-link.active {
  background: rgba(244, 114, 182, 0.1);
  color: var(--pink);
}

/* ─── Responsive ───────────────────────────── */

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-user { display: none; }
  .nav-hamburger { display: flex; }

  .nav {
    padding: 0 16px;
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .email-detail-grid { grid-template-columns: 1fr; }
  .email-row { grid-template-columns: 28px 8px 1fr; }
  .email-from, .email-meta { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar {
    display: none;
    position: fixed;
    inset: 60px 0 0 0;
    z-index: 100;
    background: var(--bg);
    border-right: none;
  }
  .chat-sidebar.open { display: flex; }
  .chat-sidebar-toggle { display: flex; }
  .filter-form { flex-wrap: wrap; }
  .container { padding: 20px 12px; }
  .page-header { flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
  .page-header h1 { font-size: 22px; }

  /* Tables: horizontal scroll on mobile */
  .card:has(.table),
  .table-wrap { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card:has(.table) .table,
  .table-wrap .table { min-width: 500px; }
  .table th, .table td { padding: 10px 8px; font-size: 13px; white-space: nowrap; }
  .action-buttons-inline { flex-direction: column; gap: 4px; }
  .linked-users { flex-wrap: wrap; }

  /* Triage review modal */
  .triage-review-modal { max-width: 100%; margin: 12px; }
  .triage-review-list { max-height: 50vh; }
  .triage-review-item-from { max-width: none; }
  .triage-review-item-count { font-size: 11px; padding: 1px 6px; }
  /* Celebration modal */
  .celebration-modal { max-width: 100%; margin: 12px; }
  .celebration-stats { gap: 16px; }
  .celebration-stat-value { font-size: 22px; }

  .light-mode .chat-sidebar {
    background: #FFFFFF;
  }
}
