/* ============================================================
   SHOWTIME22 Mail — Luxury Design System
   Gothic Dark × Metallic Gold × Shimmer
   ============================================================ */

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

/* ── Variables ───────────────────────────────────────────────── */
:root {
  --bg:         #0a0a0a;
  --bg2:        #111111;
  --bg3:        #181818;
  --bg4:        #222222;
  --gold:       #c9a84c;
  --gold-light: #fcf6ba;
  --gold-dark:  #8b6914;
  --gold-dim:   rgba(201, 168, 76, 0.12);
  --gold-grad:  linear-gradient(135deg, #bf953f 0%, #fcf6ba 50%, #b38728 75%, #fbf5b7 100%);
  --white:      #f5f5f0;
  --gray:       #888882;
  --gray2:      #555550;
  --border:     rgba(201, 168, 76, 0.22);
  --border2:    rgba(255, 255, 255, 0.06);
  --glass:      rgba(255, 255, 255, 0.03);
  --shadow:     0 8px 40px rgba(0, 0, 0, 0.9);
  --shadow-sm:  0 2px 12px rgba(0, 0, 0, 0.6);
  --shadow-gold:0 4px 25px rgba(201, 168, 76, 0.25);
  --radius:     16px;
  --radius-sm:  10px;
  --radius-xs:  6px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-gothic:'UnifrakturMaguntia', serif;
  /* Layout */
  --header-h:   64px;
  --bottom-nav-h: 68px;
  --sidebar-w:  290px;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 5px; border: 1px solid var(--border2); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px);
}

.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(201, 168, 76, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 75% 85%, rgba(201, 168, 76, 0.08) 0%, transparent 55%),
    var(--bg);
  animation: ambient-drift 16s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
  0%   { transform: scale(1); }
  100% { transform: scale(1.08) translate(-15px, -10px); }
}

.bg-canvas::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 6px var(--gold);
  opacity: 0;
  animation: float-up var(--dur, 8s) var(--delay, 0s) infinite ease-in;
}

@keyframes float-up {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  20%  { opacity: var(--op, 0.7); }
  80%  { opacity: var(--op, 0.7); }
  100% { transform: translateY(-20px) scale(1.2); opacity: 0; }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.login-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: fade-down 0.8s cubic-bezier(0.16, 1, 0.3, 1) both, float-logo 5s 0.8s ease-in-out infinite;
}

@keyframes float-logo {
  0%, 100% { transform: translateY(0px); filter: drop-shadow(0 10px 25px rgba(201, 168, 76, 0.28)); }
  50%      { transform: translateY(-10px); filter: drop-shadow(0 25px 48px rgba(201, 168, 76, 0.65)); }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  width: 280px;
  max-width: 75vw;
  height: auto;
  drop-shadow: 0 0 35px rgba(201, 168, 76, 0.45);
  transition: transform 0.4s ease;
}

/* Automatically transform black logo.png into Shimmering Luxury Gold */
img[src*="logo.png"] {
  filter: invert(1) sepia(1) saturate(5) hue-rotate(5deg) brightness(1.1) drop-shadow(0 4px 18px rgba(201, 168, 76, 0.5)) !important;
}

.login-logo:hover {
  transform: scale(1.05);
}

.login-tagline {
  font-size: 11px;
  letter-spacing: 0.45em;
  background: linear-gradient(90deg, #bf953f, #fcf6ba, #aa771c, #fcf6ba, #bf953f);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine-text 4s linear infinite;
  font-weight: 700;
  text-transform: uppercase;
}

@keyframes shine-text {
  to { background-position: 200% center; }
}

.login-card {
  width: 100%;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow), inset 0 1px 1px rgba(255,255,255,0.08), 0 0 30px rgba(201, 168, 76, 0.12);
  animation: fade-up 0.8s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both, card-pulse 6s 1s ease-in-out infinite;
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 20%; right: 20%;
  height: 1px;
  background: var(--gold-grad);
}

@keyframes card-pulse {
  0%, 100% { border-color: rgba(201, 168, 76, 0.22); box-shadow: var(--shadow), inset 0 1px 1px rgba(255,255,255,0.08), 0 0 20px rgba(201, 168, 76, 0.1); }
  50%      { border-color: rgba(201, 168, 76, 0.55); box-shadow: var(--shadow), inset 0 1px 1px rgba(255,255,255,0.15), 0 0 45px rgba(201, 168, 76, 0.28); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-card h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gray);
  text-transform: uppercase;
  margin-bottom: 28px;
  text-align: center;
}

/* ── Saved Accounts Vault (Multi-Account Picker) ─────────────── */
.saved-accounts-section {
  margin-bottom: 24px;
  animation: fade-down 0.4s ease;
}
.saved-accounts-section.hidden { display: none; }

.saved-accounts-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 14px;
  text-align: center;
}

.saved-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.saved-account-card:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(201,168,76,0.25);
}

.saved-account-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.saved-account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}

.saved-account-details {
  min-width: 0;
  overflow: hidden;
}

.saved-account-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-account-email {
  font-size: 11px;
  color: var(--gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-account-action {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
}

.btn-remove-saved {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray2);
  transition: all var(--transition);
}
.btn-remove-saved:hover {
  background: rgba(220,50,50,0.2);
  color: #ff8e8e;
}

.saved-accounts-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0 10px;
  color: var(--gray2);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.saved-accounts-divider::before,
.saved-accounts-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border2);
}
.saved-accounts-divider span {
  padding: 0 12px;
}

/* Save Account Checkbox */
.save-account-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--gray);
  transition: color var(--transition);
  margin-top: 2px;
}
.save-account-wrap:hover { color: var(--white); }
.save-account-wrap input { display: none; }

.custom-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.save-account-wrap input:checked + .custom-check {
  background: var(--gold-grad);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201,168,76,0.4);
}
.save-account-wrap input:checked + .custom-check::after {
  content: '✓';
  color: #0a0a0a;
  font-size: 13px;
  font-weight: 800;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--gold);
  pointer-events: none;
  flex-shrink: 0;
  opacity: 0.8;
  z-index: 2;
}

/* Hide browser native password reveal and clear buttons to prevent overlap */
input::-ms-reveal,
input::-ms-clear,
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
  display: none !important;
}

.input-wrap input {
  width: 100%;
  padding: 15px 50px 15px 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 15px;
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.input-wrap input::placeholder { color: var(--gray2); }

.input-wrap input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.btn-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 5;
  cursor: pointer;
  border-radius: 6px;
}
.btn-eye:hover {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}
.btn-eye svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
  position: static !important;
}

/* Luxury Metallic Gold Button */
.btn-login, .btn-send-email, .btn-compose-sidebar, .btn-compose-fab {
  position: relative;
  background: var(--gold-grad);
  color: #0a0a0a !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  transition: all var(--transition);
  overflow: hidden;
  border: none;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}

.btn-login {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 8px;
}

.btn-login::after, .btn-send-email::after, .btn-compose-sidebar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s ease;
}

.btn-login:hover, .btn-send-email:hover, .btn-compose-sidebar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201, 168, 76, 0.5);
}

.btn-login:hover::after, .btn-send-email:hover::after, .btn-compose-sidebar:hover::after {
  left: 100%;
}

.btn-login:active, .btn-send-email:active { transform: translateY(0); }

.btn-login.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-login .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #0a0a0a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.btn-login.loading .spinner { display: block; }
.btn-login.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.login-error {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(220, 50, 50, 0.15);
  border: 1px solid rgba(220, 50, 50, 0.35);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: #ff8e8e;
  margin-top: 4px;
  animation: shake 0.35s ease;
}

.login-error.show { display: flex; }

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

/* ============================================================
   INBOX APP LAYOUT
   ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw !important;
  width: 100% !important;
  overflow: hidden !important;
  position: relative;
  overscroll-behavior: none;
}

/* ── Top Header ──────────────────────────────────────────────── */
.app-header {
  height: auto;
  min-height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2000;
  flex-shrink: 0;
}

.btn-menu {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-menu:hover { background: var(--glass); }

.header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header-folder {
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Account Switcher Dropdown */
.account-switcher-wrap {
  position: relative;
  display: inline-block;
}

.header-account-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gold);
  opacity: 0.9;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--transition);
  margin-left: -6px;
}
.header-account-btn:hover { background: var(--glass); opacity: 1; }
.header-account-btn svg { width: 12px; height: 12px; }

.account-dropdown {
  position: absolute;
  top: 100%; left: 0;
  margin-top: 8px;
  width: 240px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 25px 80px rgba(0,0,0,0.95);
  padding: 8px;
  z-index: 9999;
  display: none;
  animation: fade-down 0.2s ease;
}
.account-dropdown.show { display: block; }

.account-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13px;
  color: var(--white);
}
.account-option:hover { background: var(--glass); }
.account-option.active { background: var(--gold-dim); color: var(--gold-light); font-weight: 600; }
.account-option-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-grad);
  color: #0a0a0a; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.account-add-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px;
  margin-top: 4px; border-top: 1px solid var(--border2);
  color: var(--gold); font-size: 13px; font-weight: 500;
}
.account-add-btn:hover { background: var(--glass); }

.header-actions { display: flex; align-items: center; gap: 6px; }

.btn-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--gray);
  transition: all var(--transition); position: relative;
}
.btn-icon:hover { background: var(--glass); color: var(--gold); }
.btn-icon svg { width: 20px; height: 20px; }

.menu-badge {
  position: absolute; top: 6px; right: 6px;
  width: 9px; height: 9px; background: var(--gold);
  border-radius: 50%; border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--gold);
}

/* ── Main area ───────────────────────────────────────────────── */
.app-body {
  flex: 1; display: flex; overflow: hidden; position: relative;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden; flex-shrink: 0;
  transition: transform var(--transition); z-index: 310;
}

@media (max-width: 767px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(-100%); box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.75); z-index: 300;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.sidebar-overlay.show { display: block; }

/* Sidebar Brand Logo */
.sidebar-brand-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  margin-bottom: 4px;
}
.sidebar-brand-logo {
  max-height: 26px; width: auto;
  filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.3));
  transition: transform var(--transition);
}
.sidebar-brand-wrap:hover .sidebar-brand-logo {
  transform: scale(1.04);
}
.sidebar-brand-tag {
  font-size: 10px; font-weight: 800; color: #0a0a0a;
  background: var(--gold-grad);
  padding: 3px 8px; border-radius: 4px;
  letter-spacing: 0.1em;
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.4);
}

.sidebar-account {
  padding: 16px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
}

@media (min-width: 768px) {
  .sidebar-account { padding-top: 16px; }
}

.account-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gold-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #0a0a0a;
  flex-shrink: 0; box-shadow: 0 4px 15px rgba(201, 168, 76, 0.25);
}

.account-info { overflow: hidden; }
.account-name { display: block; font-size: 15px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-email { display: block; font-size: 12px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-compose-sidebar {
  margin: 18px 16px 10px;
  padding: 14px 20px;
  border-radius: 50px;
  font-size: 13px; font-weight: 700; color: #0a0a0a;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  letter-spacing: 0.1em;
}
.btn-compose-sidebar svg { width: 18px; height: 18px; }

.folder-nav { flex: 1; overflow-y: auto; padding: 10px 10px; }

.folder-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  color: var(--gray); font-size: 14px; font-weight: 400;
  position: relative; user-select: none;
}

.folder-item:hover { background: var(--glass); color: var(--white); transform: translateX(3px); }
.folder-item.active {
  background: var(--gold-dim); color: var(--gold-light); font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.2);
}

.folder-item.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--gold-grad); border-radius: 0 3px 3px 0;
}

.folder-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.folder-label { flex: 1; }

.folder-badge {
  background: var(--gold-grad); color: #0a0a0a;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; min-width: 20px; text-align: center;
  display: none; box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}
.folder-badge.show { display: block; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

.btn-logout-sidebar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--gray); font-size: 14px; flex: 1;
  transition: all var(--transition);
}
.btn-logout-sidebar:hover { background: rgba(220, 50, 50, 0.12); color: #ff8e8e; }
.btn-logout-sidebar svg { width: 18px; height: 18px; }

.btn-shortcuts-sidebar {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray); transition: all var(--transition);
  background: var(--bg3);
}
.btn-shortcuts-sidebar:hover { color: var(--gold); background: var(--bg4); }

/* ── Email List Panel ────────────────────────────────────────── */
.email-list-panel {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; border-right: 1px solid var(--border); min-width: 0;
}
@media (max-width: 767px) { .email-list-panel { border-right: none; } }

.list-toolbar {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.list-toolbar-title { flex: 1; font-size: 13px; font-weight: 600; color: var(--gray); letter-spacing: 0.03em; }

.btn-refresh {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--gray); transition: all var(--transition);
}
.btn-refresh:hover { color: var(--gold); background: var(--glass); }
.btn-refresh svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-refresh.spinning svg { animation: spin 0.7s linear infinite; }

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

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 24px; gap: 16px; color: var(--gray); text-align: center;
}
.empty-state svg { width: 64px; height: 64px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--white); }
.empty-state p  { font-size: 13px; color: var(--gray); }

/* Luxury Shimmer Skeleton */
.skeleton {
  padding: 18px 16px; border-bottom: 1px solid var(--border2);
  display: flex; gap: 14px; align-items: flex-start;
}
.skel {
  background: linear-gradient(90deg, var(--bg3) 0%, var(--bg4) 50%, var(--bg3) 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.5s infinite linear;
}
.skel-circle { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skel-line { height: 14px; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.email-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--border2);
  cursor: pointer; transition: all var(--transition);
  position: relative; -webkit-tap-highlight-color: transparent;
  animation: fade-up 0.3s ease both;
}

.email-item:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(5px);
  border-left: 2px solid rgba(201,168,76,0.6);
}
.email-item.active {
  background: var(--gold-dim);
  border-left: 3px solid var(--gold);
}

.email-item.unread::before {
  content: ''; position: absolute; left: 5px; top: 50%;
  transform: translateY(-50%); width: 8px; height: 8px;
  border-radius: 50%; background: var(--gold-grad);
  box-shadow: 0 0 10px var(--gold);
  animation: dot-pulse 2s infinite ease-in-out;
}

@keyframes dot-pulse {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.8; box-shadow: 0 0 8px var(--gold); }
  50%      { transform: translateY(-50%) scale(1.35); opacity: 1; box-shadow: 0 0 18px var(--gold-light); }
}

.email-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg4), var(--bg3));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: var(--gold); flex-shrink: 0;
}

.email-item.unread .email-avatar {
  background: var(--gold-grad); color: #0a0a0a; border: none;
  box-shadow: 0 2px 10px rgba(201,168,76,0.3);
}

.email-content { flex: 1; min-width: 0; }
.email-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; gap: 8px; }
.email-from { font-size: 14px; font-weight: 400; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.email-item.unread .email-from { color: var(--white); font-weight: 600; }

.email-date { font-size: 11px; color: var(--gray2); flex-shrink: 0; font-weight: 500; }
.email-item.unread .email-date { color: var(--gold-light); }

.email-subject { font-size: 13px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.email-item.unread .email-subject { color: var(--white); font-weight: 600; }

.email-preview { font-size: 12px; color: var(--gray2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-flag { color: var(--gold); flex-shrink: 0; filter: drop-shadow(0 0 4px var(--gold)); }
.email-flag svg { width: 15px; height: 15px; }

.btn-load-more {
  width: 100%; padding: 18px; font-size: 13px; font-weight: 600;
  color: var(--gold); text-align: center; border-top: 1px solid var(--border2);
  transition: all var(--transition); letter-spacing: 0.05em;
}
.btn-load-more:hover { background: var(--gold-dim); color: var(--gold-light); }

/* ── Email Detail Panel ──────────────────────────────────────── */
.email-detail-panel {
  flex: 1.6; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0; background: var(--bg);
}

@media (max-width: 1023px) {
  .email-detail-panel {
    position: fixed; inset: 0;
    top: 0; bottom: 0;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    z-index: 100; transform: translateX(100%); transition: transform var(--transition);
  }
  .email-detail-panel.open { transform: translateX(0); }
}

.detail-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.btn-back {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--gold); font-size: 14px; font-weight: 500;
  transition: background var(--transition);
}
.btn-back:hover { background: var(--gold-dim); }
.btn-back svg { width: 18px; height: 18px; }
@media (min-width: 1024px) {
  .btn-back { display: none !important; }
}

.detail-toolbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.detail-content { flex: 1; overflow-y: auto; padding: 28px 24px; }
@media (min-width: 768px) { .detail-content { padding: 36px 40px; } }

/* ── Floating Luxury Logo & Detail Placeholder ──────────────── */
.detail-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 20px; color: var(--gray);
}
.floating-logo-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: float-logo 4s ease-in-out infinite;
}
.floating-logo {
  width: 220px; max-width: 80%; height: auto;
  filter: drop-shadow(0 4px 20px rgba(201, 168, 76, 0.45));
  z-index: 2;
}
.floating-glow {
  position: absolute;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.25) 0%, rgba(201, 168, 76, 0) 70%);
  border-radius: 50%;
  filter: blur(20px);
  animation: pulse-glow 3s ease-in-out infinite alternate;
  z-index: 1;
}
@keyframes float-logo {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse-glow {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 1; }
}
.placeholder-subtitle {
  font-size: 14px; color: var(--gray); letter-spacing: 0.05em; font-weight: 500; text-align: center;
}
.placeholder-badges {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px;
}
.p-badge {
  font-size: 11px; font-weight: 600; color: var(--gold-light);
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.25);
  padding: 6px 12px; border-radius: 20px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.msg-subject { font-size: 22px; font-weight: 700; color: var(--white); line-height: 1.3; margin-bottom: 24px; }
@media (min-width: 768px) { .msg-subject { font-size: 24px; } }

.msg-meta {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border);
}

.msg-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--gold-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #0a0a0a; flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(201,168,76,0.3);
}

.msg-sender { flex: 1; min-width: 0; }
.msg-sender-name { font-size: 16px; font-weight: 600; color: var(--white); display: flex; align-items: center; gap: 8px; }
.msg-sender-email { font-size: 13px; color: var(--gray); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-date { font-size: 12px; color: var(--gray); flex-shrink: 0; font-weight: 500; }

.msg-body { font-size: 15px; line-height: 1.7; color: var(--white); word-break: break-word; }
.msg-body a { color: var(--gold); }

/* Attachments */
.msg-attachments {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border);
}
.attachments-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--gold); margin-bottom: 14px; }
.attachments-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.attachment-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--white);
  transition: all var(--transition); text-decoration: none;
}
.attachment-chip:hover {
  border-color: var(--gold); background: var(--gold-dim);
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(201,168,76,0.2);
  color: var(--gold-light);
}
.attachment-chip svg { width: 18px; height: 18px; color: var(--gold); }

/* Reply area */
.reply-bar {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; flex-shrink: 0; background: var(--bg2);
}
.reply-bar button {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 50px;
  font-size: 13px; font-weight: 600; transition: all var(--transition);
}
.btn-reply-email { background: var(--gold-dim); border: 1px solid var(--border); color: var(--gold-light); }
.btn-reply-email:hover { background: rgba(201,168,76,0.25); border-color: var(--gold); transform: translateY(-1px); }

.btn-forward-email { background: transparent; border: 1px solid var(--border2); color: var(--gray); }
.btn-forward-email:hover { background: var(--glass); color: var(--white); }

.btn-delete-email { margin-left: auto; background: transparent; border: 1px solid rgba(220,50,50,0.25); color: rgba(255,140,140,0.8); }
.btn-delete-email:hover { background: rgba(220,50,50,0.15); color: #ff8e8e; border-color: rgba(220,50,50,0.5); }

/* ── Compose Overlay ─────────────────────────────────────────── */
.compose-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-end; padding: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.compose-overlay.open { opacity: 1; pointer-events: all; }

.compose-card {
  width: 100%; max-width: 640px; background: var(--bg2);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; flex-direction: column;
  height: 92vh; max-height: 750px;
  box-shadow: 0 -8px 50px rgba(0, 0, 0, 0.9);
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.compose-overlay.open .compose-card { transform: translateY(0); }

@media (min-width: 768px) {
  .compose-overlay { align-items: center; justify-content: center; }
  .compose-card {
    width: 620px; height: auto; max-height: 85vh;
    border-radius: var(--radius); border: 1px solid var(--border);
    transform: scale(0.95);
  }
  .compose-overlay.open .compose-card { transform: scale(1); }
}

.compose-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.compose-title { font-size: 15px; font-weight: 700; color: var(--gold); display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.1em; }

.btn-close-compose {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray); transition: all var(--transition);
}
.btn-close-compose:hover { background: var(--bg3); color: var(--white); }
.btn-close-compose svg { width: 18px; height: 18px; }

.compose-fields { flex-shrink: 0; }
.compose-field { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border2); }
.compose-field label { font-size: 12px; font-weight: 600; color: var(--gray); width: 56px; flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.05em; }
.compose-field input { flex: 1; background: none; border: none; outline: none; color: var(--white); font-size: 14px; padding: 0; }
.compose-field input::placeholder { color: var(--gray2); }

/* Compose attachments preview */
.compose-attachments-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 24px; border-bottom: 1px solid var(--border2);
  background: var(--bg3); max-height: 100px; overflow-y: auto;
}
.compose-att-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-xs); font-size: 12px; color: var(--white);
}
.compose-att-remove { cursor: pointer; color: #ff8e8e; font-weight: bold; margin-left: 4px; }

.compose-editor-wrap { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.compose-editor {
  flex: 1; padding: 20px 24px; outline: none; color: var(--white);
  font-size: 15px; line-height: 1.7; overflow-y: auto; min-height: 140px;
}
.compose-editor:empty::before { content: attr(data-placeholder); color: var(--gray2); pointer-events: none; }

.compose-toolbar {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.compose-format-btns { display: flex; gap: 6px; }
.compose-format-btns button, .btn-attach-file {
  width: 36px; height: 36px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray); font-size: 14px; font-weight: 700;
  transition: all var(--transition); background: var(--bg3);
}
.compose-format-btns button:hover, .btn-attach-file:hover { background: var(--bg4); color: var(--gold); }
.btn-attach-file { width: auto; padding: 0 12px; gap: 6px; font-size: 13px; font-weight: 500; }

.btn-send-email {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 50px; font-size: 13px;
  letter-spacing: 0.1em;
}
.btn-send-email:disabled { opacity: 0.5; transform: none; }
.btn-send-email svg { width: 16px; height: 16px; }

/* ── Bottom Navigation (mobile) ─────────────────────────────── */
.bottom-nav {
  height: calc(var(--bottom-nav-h) + max(0px, calc(env(safe-area-inset-bottom, 0px) - 20px)));
  padding-bottom: max(0px, calc(env(safe-area-inset-bottom, 0px) - 20px));
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border); display: flex; align-items: center;
  flex-shrink: 0; position: relative; z-index: 200;
}
@media (min-width: 768px) { .bottom-nav { display: none; } }

.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 8px 4px; color: var(--gray); font-size: 11px;
  font-weight: 500; transition: color var(--transition); position: relative;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--gold); }
.nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 25%; right: 25%;
  height: 2px; background: var(--gold-grad); border-radius: 0 0 2px 2px;
}

.nav-badge {
  position: absolute; top: 4px; right: calc(50% - 20px);
  background: var(--gold-grad); color: #0a0a0a; font-size: 9px;
  font-weight: 700; padding: 1px 6px; border-radius: 10px; min-width: 16px;
  text-align: center; display: none; box-shadow: 0 0 6px var(--gold);
}
.nav-badge.show { display: block; }

.btn-compose-fab {
  display: none !important;
}

/* ── Search overlay ──────────────────────────────────────────── */
.search-overlay, .modal-overlay {
  position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 80px 20px 20px; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.search-overlay.open, .modal-overlay.open { opacity: 1; pointer-events: all; }

.search-input-wrap, .modal-card {
  position: relative; max-width: 600px; margin: 0 auto;
}
.modal-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  margin-top: 40px;
}

.search-input-wrap svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--gold);
}
#searchInput {
  width: 100%; padding: 18px 18px 18px 52px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--white); font-size: 16px; outline: none;
}
#searchInput:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.15); }

.btn-search-close, .btn-modal-close {
  position: absolute; top: 18px; right: 18px; width: 38px; height: 38px;
  border-radius: 50%; background: var(--bg3); display: flex;
  align-items: center; justify-content: center; color: var(--gray);
}
.btn-search-close:hover, .btn-modal-close:hover { color: var(--white); background: var(--bg4); }

/* Keyboard shortcuts modal */
.shortcuts-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.shortcut-item { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--gray); }
.key-badge {
  background: var(--bg3); border: 1px solid var(--border2);
  padding: 4px 10px; border-radius: 4px; color: var(--gold-light);
  font-family: monospace; font-weight: bold; font-size: 12px;
}

/* ── Toast notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%); z-index: 500;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none; width: calc(100% - 32px); max-width: 420px;
}
@media (min-width: 768px) {
  .toast-container { bottom: 28px; left: unset; right: 28px; transform: none; }
}

.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: rgba(18, 18, 18, 0.95); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: 13px; pointer-events: all;
  animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-left: 4px solid #50c878; }
.toast.error   { border-left: 4px solid #ff6b6b; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success svg { color: #50c878; }
.toast.error   svg { color: #ff6b6b; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(15px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hidden { display: none !important; }

/* ── 1. THEMES (OLED Pure Black & Emerald Green) ─────────────── */
body.theme-oled {
  --bg: #000000;
  --bg2: #050505;
  --bg3: #0c0c0c;
  --bg4: #141414;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
}
body.theme-oled .sidebar,
body.theme-oled .bottom-nav,
body.theme-oled .email-list-panel,
body.theme-oled .email-detail-panel,
body.theme-oled .login-card {
  background: #000000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.theme-emerald {
  --gold: #50c878;
  --gold-light: #7ef2a0;
  --gold-dark: #237a44;
  --gold-grad: linear-gradient(135deg, #237a44, #50c878, #7ef2a0);
  --bg: #030805;
  --bg2: #06110a;
  --bg3: #0b1f13;
  --bg4: #12301d;
  --border: rgba(80, 200, 120, 0.22);
}
body.theme-emerald .sidebar-brand-logo,
body.theme-emerald .login-logo {
  filter: drop-shadow(0 0 15px rgba(80, 200, 120, 0.6)) !important;
}

/* ── THEME: CITY SKY BLUE (Manchester City VIP) ──────────────── */
body.theme-city {
  --gold: #6cabdd;
  --gold-light: #9ee2ff;
  --gold-dark: #1f649a;
  --gold-grad: linear-gradient(135deg, #1d5084 0%, #6cabdd 50%, #9ee2ff 100%);
  --bg: #050d14;
  --bg2: #091522;
  --bg3: #112235;
  --bg4: #1a334e;
  --border: rgba(108, 171, 221, 0.26);
}
body.theme-city .sidebar-brand-logo,
body.theme-city .login-logo {
  filter: drop-shadow(0 0 16px rgba(108, 171, 221, 0.7)) !important;
}

/* ── THEME: RUBY ROYALE (Deep Crimson & Rose Gold) ───────────── */
body.theme-ruby {
  --gold: #e04a5e;
  --gold-light: #ff8e9e;
  --gold-dark: #8c1c2b;
  --gold-grad: linear-gradient(135deg, #8c1c2b 0%, #e04a5e 50%, #ff8e9e 100%);
  --bg: #0a0405;
  --bg2: #120709;
  --bg3: #1f0d11;
  --bg4: #2d1319;
  --border: rgba(224, 74, 94, 0.26);
}
body.theme-ruby .sidebar-brand-logo,
body.theme-ruby .login-logo {
  filter: drop-shadow(0 0 16px rgba(224, 74, 94, 0.7)) !important;
}

/* ── 2. FILTER PILLS & HIGHLIGHT ─────────────────────────────── */
.filter-pills-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
  flex-shrink: 0;
}
.filter-pills-bar::-webkit-scrollbar { display: none; }
.filter-pill {
  padding: 6px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 600; color: var(--gray);
  background: var(--bg3); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.filter-pill:hover, .filter-pill.active {
  background: var(--gold-grad); color: #0a0a0a;
  border-color: transparent; box-shadow: 0 2px 10px rgba(201, 168, 76, 0.35);
}
body.theme-emerald .filter-pill:hover, body.theme-emerald .filter-pill.active {
  box-shadow: 0 2px 10px rgba(80, 200, 120, 0.35);
}
.gold-highlight {
  background: rgba(201, 168, 76, 0.35);
  color: var(--gold-light);
  padding: 1px 3px; border-radius: 3px; font-weight: 700;
}
body.theme-emerald .gold-highlight {
  background: rgba(80, 200, 120, 0.35);
  color: #7ef2a0;
}
body.theme-city .filter-pill:hover, body.theme-city .filter-pill.active {
  box-shadow: 0 2px 10px rgba(108, 171, 221, 0.4);
}
body.theme-city .gold-highlight {
  background: rgba(108, 171, 221, 0.35);
  color: #9ee2ff;
}
body.theme-ruby .filter-pill:hover, body.theme-ruby .filter-pill.active {
  box-shadow: 0 2px 10px rgba(224, 74, 94, 0.4);
}
body.theme-ruby .gold-highlight {
  background: rgba(224, 74, 94, 0.35);
  color: #ff8e9e;
}

/* ── 3. SWIPE-TO-ACTION (MOBILE) ─────────────────────────────── */
.email-item {
  position: relative; overflow: hidden; padding: 0 !important;
  touch-action: pan-y;
}
.swipe-bg-left, .swipe-bg-right {
  position: absolute; top: 8px; bottom: 8px; width: 85px;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  z-index: 1; pointer-events: none; opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-xs); letter-spacing: 0.02em;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}
.swipe-bg-left {
  right: 12px;
  background: linear-gradient(135deg, #e53e3e, #c53030); color: #fff;
  transform: scale(0.85) translateX(10px);
}
.swipe-bg-right {
  left: 12px;
  background: linear-gradient(135deg, #38a169, #276749); color: #fff;
  transform: scale(0.85) translateX(-10px);
}
.email-item.swiping-left .swipe-bg-left { opacity: 1; transform: scale(1) translateX(0); }
.email-item.swiping-right .swipe-bg-right { opacity: 1; transform: scale(1) translateX(0); }
.email-item-inner {
  position: relative; z-index: 2; width: 100%;
  background: var(--bg); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px;
}
.email-item.unread .email-item-inner { background: var(--bg2); }
.email-item.active .email-item-inner { background: var(--gold-dim); }

/* ── 4. QUICK REPLY INLINE BOX ───────────────────────────────── */
.quick-reply-wrap {
  padding: 16px 20px; background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}
.quick-reply-row {
  display: flex; align-items: center; gap: 10px;
}
.quick-reply-input {
  flex: 1; padding: 12px 18px; border-radius: 25px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--white); font-size: 13px; outline: none;
  transition: all var(--transition);
}
.quick-reply-input:focus {
  border-color: var(--gold); background: var(--bg);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}
.btn-quick-send {
  padding: 10px 20px; border-radius: 25px;
  background: var(--gold-grad); color: #0a0a0a;
  font-size: 13px; font-weight: 700; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-quick-send:hover {
  transform: scale(1.05); box-shadow: 0 4px 15px rgba(201, 168, 76, 0.4);
}

/* ── 5. LIGHTBOX MODAL & DRAG/DROP ZONE ──────────────────────── */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease; backdrop-filter: blur(10px);
}
.lightbox-overlay.open { opacity: 1; pointer-events: all; }
.lightbox-content {
  max-width: 90vw; max-height: 85vh; object-fit: contain;
  border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-overlay.open .lightbox-content { transform: scale(1); }
.btn-lightbox-close {
  position: absolute; top: 24px; right: 24px; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.15); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; border: none; cursor: pointer; transition: background 0.2s;
}
.btn-lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }
.compose-card.dropzone-active {
  border: 2px dashed var(--gold) !important;
  box-shadow: 0 0 35px rgba(201, 168, 76, 0.5) !important;
  background: rgba(201, 168, 76, 0.08) !important;
}

/* ── 7. ACCOUNT SETTINGS & SIGNATURE MODAL ───────────────────── */
.settings-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.88);
  z-index: 9999; display: none; padding: 24px 16px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.settings-overlay.open {
  display: block !important;
}
.settings-card {
  width: 100%; max-width: 660px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 30px rgba(201,168,76,0.15);
  padding: 24px; position: relative; height: auto; display: flex; flex-direction: column; gap: 16px;
  margin: 20px auto;
}
.settings-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.settings-title { font-size: 18px; font-weight: 700; color: var(--white); display: flex; align-items: center; gap: 8px; }
.btn-settings-close { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gray); transition: all 0.2s; }
.btn-settings-close:hover { background: var(--glass); color: var(--white); }

/* ── VIP SETTINGS TABS & PROFILE CARD ─────────────────────────── */
.settings-profile-info { display: flex; align-items: center; gap: 14px; }
.settings-avatar-badge {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--gold-grad); color: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.35); flex-shrink: 0;
}
.settings-nav-tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border);
  padding-bottom: 12px; overflow-x: auto; scrollbar-width: none;
}
.settings-nav-tabs::-webkit-scrollbar { display: none; }
.settings-nav-tab {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--gray); background: var(--bg3); border: 1px solid transparent;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.settings-nav-tab:hover { color: var(--white); background: var(--bg4); }
.settings-nav-tab.active {
  background: var(--gold-dim); color: var(--gold-light);
  border-color: var(--gold); box-shadow: 0 2px 10px rgba(201, 168, 76, 0.2);
}
body.theme-city .settings-nav-tab.active {
  background: rgba(108, 171, 221, 0.15); color: #9ee2ff; border-color: #6cabdd;
}
body.theme-emerald .settings-nav-tab.active {
  background: rgba(80, 200, 120, 0.15); color: #7ef2a0; border-color: #50c878;
}
body.theme-ruby .settings-nav-tab.active {
  background: rgba(224, 74, 94, 0.15); color: #ff8e9e; border-color: #e04a5e;
}

/* ══════════════════════════════════════════════════════════════════
   🌃 NEON TOKYO — Cyberpunk / Synthwave
   Font: monospace techy, violet neon + cyan accente, scanlines
   ══════════════════════════════════════════════════════════════════ */
body.theme-neon {
  --gold:       #bf5fff;
  --gold-light: #e8b8ff;
  --gold-dark:  #7b00d4;
  --gold-dim:   rgba(191, 95, 255, 0.12);
  --gold-grad:  linear-gradient(135deg, #00f5ff 0%, #bf5fff 50%, #ff2d78 100%);
  --bg:         #080010;
  --bg2:        #0d0020;
  --bg3:        #130030;
  --bg4:        #1c0048;
  --border:     rgba(191, 95, 255, 0.35);
  --border2:    rgba(0, 245, 255, 0.12);
  --white:      #e8e8ff;
  --gray:       #8888bb;
  --gray2:      #44445a;
  --shadow:     0 8px 40px rgba(191, 95, 255, 0.4);
  --shadow-gold:0 4px 30px rgba(191, 95, 255, 0.5);
  --font-body:  'Courier New', 'Consolas', monospace;
  --radius:     4px;
  --radius-sm:  2px;
}
body.theme-neon::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
}
body.theme-neon .app-header {
  background: rgba(8, 0, 16, 0.95) !important;
  border-bottom: 1px solid rgba(191, 95, 255, 0.4) !important;
  box-shadow: 0 1px 0 rgba(0, 245, 255, 0.15), 0 4px 20px rgba(191, 95, 255, 0.3) !important;
}
body.theme-neon .sidebar {
  background: linear-gradient(180deg, #0d0020 0%, #080010 100%) !important;
  border-right: 1px solid rgba(191, 95, 255, 0.3) !important;
  box-shadow: 4px 0 20px rgba(191, 95, 255, 0.2) !important;
}
body.theme-neon .email-item:hover {
  background: rgba(191, 95, 255, 0.08) !important;
  box-shadow: inset 2px 0 0 #bf5fff, 0 0 20px rgba(191, 95, 255, 0.1) !important;
}
body.theme-neon .email-item.unread {
  border-left: 2px solid #00f5ff !important;
}
body.theme-neon .folder-item.active {
  background: rgba(191, 95, 255, 0.15) !important;
  box-shadow: inset 2px 0 0 #bf5fff, 0 0 15px rgba(191, 95, 255, 0.2) !important;
}
body.theme-neon .btn-login, body.theme-neon .filter-pill.active, body.theme-neon .filter-pill:hover {
  box-shadow: 0 0 15px rgba(191, 95, 255, 0.6), 0 0 30px rgba(191, 95, 255, 0.2) !important;
}
body.theme-neon .sidebar-brand-logo, body.theme-neon .login-logo {
  filter: drop-shadow(0 0 20px rgba(191, 95, 255, 0.9)) drop-shadow(0 0 40px rgba(0, 245, 255, 0.5)) !important;
}
body.theme-neon .header-account-btn, body.theme-neon .btn-icon {
  font-family: 'Courier New', monospace;
}
body.theme-neon .app-version-pill {
  background: rgba(0, 245, 255, 0.1) !important;
  border-color: #00f5ff !important;
  color: #00f5ff !important;
  text-shadow: 0 0 8px #00f5ff;
}
body.theme-neon .settings-nav-tab.active {
  background: rgba(191, 95, 255, 0.15); color: #e8b8ff; border-color: #bf5fff;
  box-shadow: 0 0 12px rgba(191, 95, 255, 0.4);
}
body.theme-neon .gold-highlight { background: rgba(191, 95, 255, 0.3); color: #e8b8ff; }
body.theme-neon .filter-pill:hover, body.theme-neon .filter-pill.active {
  box-shadow: 0 0 12px rgba(191, 95, 255, 0.6);
}

/* ══════════════════════════════════════════════════════════════════
   🏛️ MARBLE LUXE — Elegant White & Champagne (Light Theme)
   Font: serif elegant, champagne/platinum tones, marble texture
   ══════════════════════════════════════════════════════════════════ */
body.theme-marble {
  --gold:       #b8966a;
  --gold-light: #d4af7a;
  --gold-dark:  #8a6840;
  --gold-dim:   rgba(184, 150, 106, 0.15);
  --gold-grad:  linear-gradient(135deg, #c8a882 0%, #f5e6c8 40%, #b8966a 70%, #ecdfc8 100%);
  --bg:         #f5f2ed;
  --bg2:        #eeebe4;
  --bg3:        #e6e1d8;
  --bg4:        #ddd8cc;
  --border:     rgba(184, 150, 106, 0.3);
  --border2:    rgba(0, 0, 0, 0.08);
  --white:      #1a1410;
  --gray:       #6b5f50;
  --gray2:      #a09080;
  --shadow:     0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-gold:0 4px 25px rgba(184, 150, 106, 0.3);
  --font-body:  'Georgia', 'Times New Roman', serif;
  --radius:     20px;
  --radius-sm:  12px;
}
body.theme-marble {
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(220, 210, 195, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(200, 185, 165, 0.4) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.015' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}
body.theme-marble .app-header {
  background: rgba(238, 235, 228, 0.97) !important;
  border-bottom: 1px solid rgba(184, 150, 106, 0.25) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08) !important;
  backdrop-filter: blur(20px);
}
body.theme-marble .sidebar {
  background: linear-gradient(180deg, #ece8e0 0%, #e6e0d4 100%) !important;
  border-right: 1px solid rgba(184, 150, 106, 0.2) !important;
}
body.theme-marble .email-item {
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
}
body.theme-marble .email-item:hover { background: rgba(184, 150, 106, 0.08) !important; }
body.theme-marble .folder-item.active {
  background: rgba(184, 150, 106, 0.15) !important;
  border-left: 2px solid #b8966a;
}
body.theme-marble .sidebar-brand-logo, body.theme-marble .login-logo {
  filter: sepia(20%) contrast(0.95) !important;
}
body.theme-marble .app-version-pill {
  background: rgba(184, 150, 106, 0.15) !important;
}
body.theme-marble .email-list-panel, body.theme-marble .email-detail-panel {
  background: #f5f2ed !important;
}
body.theme-marble .settings-nav-tab.active {
  background: rgba(184, 150, 106, 0.15); color: #8a6840; border-color: #b8966a;
}
body.theme-marble .gold-highlight { background: rgba(184, 150, 106, 0.25); color: #8a6840; }
body.theme-marble .filter-pill { color: #6b5f50; }
body.theme-marble .filter-pill:hover, body.theme-marble .filter-pill.active {
  box-shadow: 0 2px 10px rgba(184, 150, 106, 0.3);
}
body.theme-marble .bottom-nav {
  background: rgba(238, 235, 228, 0.97) !important;
  border-top: 1px solid rgba(184, 150, 106, 0.2) !important;
}

/* ══════════════════════════════════════════════════════════════════
   🌿 FOREST ZEN — Deep Woods & Organic Moss
   Texturi organice, verde profund, tipografie rotunjită
   ══════════════════════════════════════════════════════════════════ */
body.theme-forest {
  --gold:       #6db87a;
  --gold-light: #a8e6b0;
  --gold-dark:  #2d6b38;
  --gold-dim:   rgba(109, 184, 122, 0.12);
  --gold-grad:  linear-gradient(135deg, #1a4d28 0%, #3a8a4a 40%, #6db87a 70%, #a8d8a0 100%);
  --bg:         #050f08;
  --bg2:        #0a1a0d;
  --bg3:        #0f2414;
  --bg4:        #16321c;
  --border:     rgba(109, 184, 122, 0.22);
  --border2:    rgba(109, 184, 122, 0.08);
  --white:      #e8f5e8;
  --gray:       #6a9070;
  --gray2:      #3a5840;
  --shadow:     0 8px 40px rgba(0, 0, 0, 0.8);
  --shadow-gold:0 4px 25px rgba(109, 184, 122, 0.3);
  --radius:     18px;
  --radius-sm:  12px;
}
body.theme-forest {
  background-image:
    radial-gradient(ellipse at 30% 70%, rgba(20, 60, 25, 0.8) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 20%, rgba(10, 35, 15, 0.6) 0%, transparent 50%);
}
body.theme-forest .app-header {
  background: rgba(5, 15, 8, 0.95) !important;
  border-bottom: 1px solid rgba(109, 184, 122, 0.2) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6) !important;
}
body.theme-forest .sidebar {
  background: linear-gradient(160deg, #0a1a0d 0%, #050f08 100%) !important;
  border-right: 1px solid rgba(109, 184, 122, 0.15) !important;
}
body.theme-forest .email-item.unread { border-left: 2px solid #6db87a !important; }
body.theme-forest .folder-item.active {
  background: rgba(109, 184, 122, 0.12) !important;
  box-shadow: inset 2px 0 0 #6db87a !important;
}
body.theme-forest .sidebar-brand-logo, body.theme-forest .login-logo {
  filter: drop-shadow(0 0 15px rgba(109, 184, 122, 0.7)) hue-rotate(90deg) !important;
}
body.theme-forest .settings-nav-tab.active {
  background: rgba(109, 184, 122, 0.15); color: #a8e6b0; border-color: #6db87a;
}
body.theme-forest .gold-highlight { background: rgba(109, 184, 122, 0.25); color: #a8e6b0; }
body.theme-forest .filter-pill:hover, body.theme-forest .filter-pill.active {
  box-shadow: 0 2px 12px rgba(109, 184, 122, 0.4);
}
body.theme-forest .btn-login { letter-spacing: 0.05em; }

/* ══════════════════════════════════════════════════════════════════
   🔥 VOLCANIC LAVA — Magma & Fire
   Gradient dramatic portocaliu/rosu, efecte de caldura, intense
   ══════════════════════════════════════════════════════════════════ */
body.theme-volcanic {
  --gold:       #ff6b1a;
  --gold-light: #ffb380;
  --gold-dark:  #cc3300;
  --gold-dim:   rgba(255, 107, 26, 0.12);
  --gold-grad:  linear-gradient(135deg, #ff0000 0%, #ff4500 30%, #ff8c00 60%, #ffd700 100%);
  --bg:         #0f0500;
  --bg2:        #1a0800;
  --bg3:        #2a0e00;
  --bg4:        #3d1500;
  --border:     rgba(255, 107, 26, 0.3);
  --border2:    rgba(255, 107, 26, 0.08);
  --white:      #fff5e6;
  --gray:       #aa7050;
  --gray2:      #664028;
  --shadow:     0 8px 40px rgba(255, 50, 0, 0.3);
  --shadow-gold:0 4px 30px rgba(255, 107, 26, 0.5);
  --radius:     6px;
  --radius-sm:  4px;
}
body.theme-volcanic {
  background-image:
    radial-gradient(ellipse at 50% 100%, rgba(200, 50, 0, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(150, 20, 0, 0.3) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 60%, rgba(255, 80, 0, 0.2) 0%, transparent 40%);
}
body.theme-volcanic .app-header {
  background: linear-gradient(90deg, #1a0800 0%, #0f0500 100%) !important;
  border-bottom: 1px solid rgba(255, 100, 0, 0.3) !important;
  box-shadow: 0 2px 20px rgba(255, 50, 0, 0.2) !important;
}
body.theme-volcanic .sidebar {
  background: linear-gradient(180deg, #1a0800 0%, #0f0500 100%) !important;
  border-right: 1px solid rgba(255, 100, 0, 0.2) !important;
}
body.theme-volcanic .email-item.unread {
  border-left: 2px solid #ff6b1a !important;
}
body.theme-volcanic .email-item:hover {
  background: rgba(255, 107, 26, 0.07) !important;
}
body.theme-volcanic .folder-item.active {
  background: rgba(255, 107, 26, 0.12) !important;
  box-shadow: inset 2px 0 0 #ff6b1a !important;
}
body.theme-volcanic .sidebar-brand-logo, body.theme-volcanic .login-logo {
  filter: drop-shadow(0 0 18px rgba(255, 100, 0, 0.9)) sepia(30%) !important;
}
body.theme-volcanic .settings-nav-tab.active {
  background: rgba(255, 107, 26, 0.15); color: #ffb380; border-color: #ff6b1a;
}
body.theme-volcanic .gold-highlight { background: rgba(255, 107, 26, 0.25); color: #ffb380; }
body.theme-volcanic .filter-pill:hover, body.theme-volcanic .filter-pill.active {
  box-shadow: 0 0 15px rgba(255, 107, 26, 0.5);
}
body.theme-volcanic .app-version-pill {
  background: rgba(255, 107, 26, 0.15) !important;
  border-color: #ff6b1a !important;
  color: #ffb380 !important;
}

/* ══════════════════════════════════════════════════════════════════
   🌌 DEEP SPACE — Cosmic Nebula & Purple Galaxy
   Stele animate, mov profund cosmic, efecte de galaxie
   ══════════════════════════════════════════════════════════════════ */
body.theme-space {
  --gold:       #9b6dff;
  --gold-light: #c4a8ff;
  --gold-dark:  #5a3dbb;
  --gold-dim:   rgba(155, 109, 255, 0.12);
  --gold-grad:  linear-gradient(135deg, #1a0066 0%, #6633cc 35%, #9b6dff 60%, #c4a8ff 80%, #ff99cc 100%);
  --bg:         #02000a;
  --bg2:        #060014;
  --bg3:        #0c0022;
  --bg4:        #130033;
  --border:     rgba(155, 109, 255, 0.25);
  --border2:    rgba(155, 109, 255, 0.08);
  --white:      #eeeaff;
  --gray:       #8888bb;
  --gray2:      #44445a;
  --shadow:     0 8px 40px rgba(100, 50, 255, 0.3);
  --shadow-gold:0 4px 30px rgba(155, 109, 255, 0.5);
  --radius:     16px;
}
body.theme-space {
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(100, 0, 200, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(50, 0, 150, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 80, 0.5) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='stars'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.5  0 0 0 0 0.4  0 0 0 0 1  0 0 0 8 -6'/%3E%3C/filter%3E%3Crect width='600' height='600' filter='url(%23stars)' opacity='0.5'/%3E%3C/svg%3E");
}
body.theme-space .app-header {
  background: rgba(2, 0, 10, 0.95) !important;
  border-bottom: 1px solid rgba(155, 109, 255, 0.25) !important;
  box-shadow: 0 2px 30px rgba(100, 50, 255, 0.2) !important;
}
body.theme-space .sidebar {
  background: linear-gradient(180deg, #060014 0%, #02000a 100%) !important;
  border-right: 1px solid rgba(155, 109, 255, 0.2) !important;
}
body.theme-space .email-item.unread { border-left: 2px solid #9b6dff !important; }
body.theme-space .email-item:hover { background: rgba(155, 109, 255, 0.07) !important; }
body.theme-space .folder-item.active {
  background: rgba(155, 109, 255, 0.12) !important;
  box-shadow: inset 2px 0 0 #9b6dff, 0 0 20px rgba(155, 109, 255, 0.15) !important;
}
body.theme-space .sidebar-brand-logo, body.theme-space .login-logo {
  filter: drop-shadow(0 0 20px rgba(155, 109, 255, 0.9)) drop-shadow(0 0 50px rgba(100, 50, 200, 0.5)) !important;
}
body.theme-space .btn-login, body.theme-space .filter-pill.active, body.theme-space .filter-pill:hover {
  box-shadow: 0 0 20px rgba(155, 109, 255, 0.5), 0 0 40px rgba(155, 109, 255, 0.2) !important;
}
body.theme-space .settings-nav-tab.active {
  background: rgba(155, 109, 255, 0.15); color: #c4a8ff; border-color: #9b6dff;
  box-shadow: 0 0 12px rgba(155, 109, 255, 0.3);
}
body.theme-space .gold-highlight { background: rgba(155, 109, 255, 0.25); color: #c4a8ff; }
body.theme-space .filter-pill:hover, body.theme-space .filter-pill.active {
  box-shadow: 0 0 15px rgba(155, 109, 255, 0.5);
}
body.theme-space .app-version-pill {
  background: rgba(155, 109, 255, 0.12) !important;
  border-color: #9b6dff !important;
  color: #c4a8ff !important;
  text-shadow: 0 0 10px rgba(155, 109, 255, 0.6);
}

.settings-tab-content { display: flex; flex-direction: column; gap: 16px; }

/* Switch Toggle */
.switch-toggle {
  position: relative; display: inline-block; width: 42px; height: 24px;
}
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background-color: var(--bg); border: 1px solid var(--border);
  border-radius: 24px; transition: .3s;
}
.switch-slider:before {
  position: absolute; content: ""; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background-color: var(--gray);
  border-radius: 50%; transition: .3s;
}
input:checked + .switch-slider { background-color: var(--gold-dim); border-color: var(--gold); }
input:checked + .switch-slider:before { transform: translateX(18px); background-color: var(--gold); }

.settings-body { height: auto; display: flex; flex-direction: column; gap: 16px; }
.settings-tab-content { display: flex; flex-direction: column; gap: 16px; height: auto; }
.settings-field { display: flex; flex-direction: column; gap: 6px; }
.settings-label { font-size: 12px; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; }
.settings-textarea { width: 100%; min-height: 120px; background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 12px; color: var(--white); font-family: monospace; font-size: 13px; line-height: 1.5; resize: vertical; }
.settings-textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px rgba(201,168,76,0.2); }
.sig-preview-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; min-height: 70px; font-size: 13px; color: var(--white); }
.preset-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-preset { padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--gray); font-size: 12px; cursor: pointer; transition: all 0.2s; }
.btn-preset:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-dim); }

/* Signature Dual Mode Editor Styles */
.sig-mode-tabs { display: flex; gap: 4px; background: var(--bg3); padding: 3px; border-radius: var(--radius-xs); border: 1px solid var(--border); }
.sig-tab-btn { padding: 5px 12px; font-size: 11px; font-weight: 600; color: var(--gray); border-radius: 4px; border: none; background: transparent; cursor: pointer; transition: all 0.2s; }
.sig-tab-btn:hover { color: var(--white); }
.sig-tab-btn.active { background: var(--gold-grad); color: #0a0a0a; font-weight: 700; box-shadow: 0 2px 8px rgba(201,168,76,0.3); }
.sig-friendly-wrap { display: flex; flex-direction: column; border: 1px solid var(--border2); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg3); }
.sig-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sig-tool-btn { padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg3); color: var(--white); font-size: 12px; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; }
.sig-tool-btn:hover { border-color: var(--gold); background: var(--gold-dim); color: var(--gold-light); transform: translateY(-1px); }
.sig-tool-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.settings-visual-editor { min-height: 130px; padding: 14px; color: var(--white); font-family: 'Inter', sans-serif; font-size: 13px; line-height: 1.6; outline: none; overflow-y: auto; max-height: 250px; }
.settings-visual-editor:focus { box-shadow: inset 0 0 0 2px rgba(201,168,76,0.3); }

/* ── 8. PERSONS / TEAM MEMBER SIGNATURE SYSTEM ───────────────── */
.header-person-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--gold-dim); border: 1px solid var(--border);
  color: var(--gold-light); font-size: 11px; font-weight: 600;
  transition: all var(--transition); cursor: pointer; letter-spacing: 0.02em;
}
.header-person-badge:hover {
  background: rgba(201,168,76,0.25); border-color: var(--gold); transform: translateY(-1px);
}

.person-select-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
}
.person-select-card:hover {
  border-color: var(--gold); background: var(--gold-dim); transform: translateX(3px);
}
.person-select-card.active {
  background: var(--gold-grad); color: #0a0a0a; border-color: transparent; font-weight: 700;
  box-shadow: 0 4px 15px rgba(201,168,76,0.3);
}
.person-select-card.active .person-card-sub { color: #111 !important; font-weight: 600; }
.person-card-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg2);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
  border: 1px solid var(--border);
}
.person-select-card.active .person-card-avatar { background: rgba(0,0,0,0.15); border-color: rgba(0,0,0,0.3); }

.settings-person-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-xs); transition: all var(--transition); cursor: pointer;
}
.settings-person-item:hover { border-color: var(--border); background: var(--bg3); }
.settings-person-item.active { border-left: 3px solid var(--gold); background: rgba(201,168,76,0.12); border-color: var(--border); }
.btn-delete-person {
  width: 28px; height: 28px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  color: #ff8e8e; background: rgba(220,50,50,0.15); border: 1px solid rgba(220,50,50,0.3); transition: all 0.2s;
  cursor: pointer;
}
.btn-delete-person:hover { background: rgba(220,50,50,0.3); transform: scale(1.05); }

/* ── 9. PROGRESSIVE WEB APP (PWA) VIP OPTIMIZATIONS ──────────── */
.offline-banner {
  width: 100%; background: linear-gradient(90deg, #b01818, #d32f2f, #b01818);
  color: #fff; font-size: 12px; font-weight: 600; text-align: center;
  padding: 8px 16px; letter-spacing: 0.03em; box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  transition: all 0.3s ease; z-index: 2500;
}
.offline-banner.hidden { display: none !important; }

.sidebar-pwa-wrap {
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.btn-pwa-install {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--gold-grad); color: #0a0a0a; font-size: 12px; font-weight: 700;
  border: none; cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 15px rgba(201,168,76,0.35); letter-spacing: 0.03em;
}
.btn-pwa-install:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,168,76,0.55);
}
.btn-pwa-install:active { transform: translateY(0); }

/* Ascunde butonul de instalare când aplicația rulează deja în mod PWA (Standalone/Fullscreen/Minimal-UI) */
@media all and (display-mode: standalone), (display-mode: window-controls-overlay), (display-mode: minimal-ui), (display-mode: fullscreen) {
  #sidebarPwaWrap, .sidebar-pwa-wrap, .btn-pwa-install {
    display: none !important;
  }
}

/* ── 10. THEME PICKER (SETTINGS MODAL) ───────────────────────── */
.theme-picker-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}
.btn-theme-pill {
  padding: 8px 14px; border-radius: 20px; font-size: 11px; font-weight: 700;
  background: var(--bg2); color: var(--white); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition); display: flex; align-items: center; gap: 6px;
}
.btn-theme-pill::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  background: var(--t-color, var(--gold)); box-shadow: 0 0 6px var(--t-color, var(--gold));
}
.btn-theme-pill:hover, .btn-theme-pill.active {
  background: var(--gold-dim); border-color: var(--gold);
  transform: translateY(-1px); box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

@media (max-width: 767px) {
  .settings-overlay {
    padding: 0 !important;
    display: block !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .settings-card {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 16px !important;
    overflow: visible !important;
  }
  .settings-body, .settings-tab-content {
    overflow: visible !important;
    height: auto !important;
  }
}


