/* ═══════════════════════════════════════════════════════════════════
   yourdomain.com mail — Neon Glass Dark Theme
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg:           #04020e;
  --glass:        rgba(8, 2, 28, 0.55);
  --glass-hi:     rgba(14, 4, 44, 0.50);
  --border:       rgba(0, 255, 136, 0.28);
  --border-hi:    rgba(0, 255, 136, 0.65);
  --green:        #00ff88;
  --green-dim:    #00cc6a;
  --green-glow:   rgba(0, 255, 136, 0.22);
  --purple:       #7c3aed;
  --purple-bright:#a855f7;
  --purple-dark:  rgba(18, 0, 52, 0.72);
  --text:         #d4ffe8;
  --text-dim:     #6abf90;
  --text-muted:   #2e5a42;
  --hover:        rgba(0, 255, 136, 0.10);
  --selected:     rgba(0, 255, 136, 0.16);
  --danger:       #ff4477;
  --radius:       10px;
  --blur:         blur(20px) saturate(180%);
  --topbar-h:     88px;
  --sidebar-w:    220px;
  --list-w:       320px;
  --transition:   0.18s ease;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* ── NEON BACKGROUND GLOWS ─────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 65% 55% at 10% 0%,    rgba(124, 58, 237, 0.55) 0%, transparent 65%),
    radial-gradient(ellipse 50% 60% at 90% 100%,  rgba(0,  255, 136, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 40% 40% at 80% 10%,   rgba(124, 58, 237, 0.20) 0%, transparent 55%),
    radial-gradient(ellipse 35% 35% at 20% 90%,   rgba(0,  255, 136, 0.12) 0%, transparent 55%),
    #04020e;
}

body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 30% 25% at 50% 50%, rgba(124, 58, 237, 0.06) 0%, transparent 70%);
}

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

.hidden { display: none !important; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,255,136,0.30); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); box-shadow: 0 0 8px rgba(0,255,136,0.6); }

a { color: var(--green); text-decoration: none; }
button { cursor: pointer; font: inherit; }

/* ── VIEWS ─────────────────────────────────────────────────────── */
.view { width: 100%; height: 100%; }

/* ── LOGIN ─────────────────────────────────────────────────────── */
#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(0,255,136,0.14),
    0 16px 70px rgba(0,0,0,0.70),
    0 0 100px rgba(124,58,237,0.25),
    0 0 40px  rgba(0,255,136,0.08);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  justify-content: center;
}

.login-logo-img {
  width: 340px;
  max-width: 100%;
  height: auto;
  display: block;
}

.logo-icon {
  font-size: 2em;
  line-height: 1;
}

.logo-icon i {
  color: var(--green);
  filter: drop-shadow(0 0 12px rgba(0,255,136,0.9)) drop-shadow(0 0 28px rgba(0,255,136,0.5));
}

.logo-text {
  font-size: 1.4em;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.logo-dot { color: var(--green); text-shadow: 0 0 10px rgba(0,255,136,0.7); }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(0,255,136,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.95em;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,255,136,0.16), 0 0 20px rgba(0,255,136,0.14);
  background: rgba(0,255,136,0.08);
}

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

.btn-admin-topbar {
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(90,20,180,0.15));
  border: 1px solid rgba(124,58,237,0.60);
  color: var(--purple-bright);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.88em;
  letter-spacing: 0.04em;
  box-shadow: 0 0 18px rgba(124,58,237,0.25);
  transition: all var(--transition);
}

.btn-admin-topbar:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.45), rgba(90,20,180,0.30));
  box-shadow: 0 0 30px rgba(124,58,237,0.55), 0 0 60px rgba(124,58,237,0.20);
  color: #fff;
  text-shadow: 0 0 8px rgba(168,85,247,0.9);
}

.btn-admin-topbar i { margin-right: 5px; }

.btn-primary {
  background: linear-gradient(135deg, rgba(0,255,136,0.20), rgba(0,180,80,0.12));
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 8px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 0.95em;
  letter-spacing: 0.04em;
  box-shadow: 0 0 20px rgba(0,255,136,0.22), inset 0 0 20px rgba(0,255,136,0.04);
  transition: all var(--transition);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(0,255,136,0.35), rgba(0,200,90,0.25));
  box-shadow: 0 0 40px rgba(0,255,136,0.50), 0 0 80px rgba(0,255,136,0.20), inset 0 0 20px rgba(0,255,136,0.08);
  color: #fff;
  text-shadow: 0 0 10px rgba(0,255,136,1);
}

.btn-primary:active { transform: scale(0.98); }

.btn-block { width: 100%; margin-top: 8px; padding: 13px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 9px 16px;
  transition: all var(--transition);
}

.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 12px rgba(0,255,136,0.20);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9em;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.icon-btn:hover {
  color: var(--green);
  background: var(--hover);
  box-shadow: 0 0 10px rgba(0,255,136,0.15);
}

.icon-btn:hover i,
.icon-btn:focus-visible i {
  color: var(--green);
  filter: drop-shadow(0 0 6px rgba(0,255,136,0.70));
}

#btn-delete:hover i {
  color: var(--danger);
  filter: drop-shadow(0 0 6px rgba(255,68,119,0.70));
}

.btn-primary i, .btn-ghost i { margin-right: 3px; }

.error-msg {
  background: rgba(255,68,119,0.10);
  border: 1px solid rgba(255,68,119,0.40);
  color: #ff99bb;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 0.88em;
  margin-bottom: 12px;
}

/* ── TOP BAR ───────────────────────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(4, 1, 16, 0.88);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 30px rgba(124,58,237,0.18), 0 0 60px rgba(0,255,136,0.05);
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-animated {
  height: 80px;
  width: 480px;
  max-width: none;
}

.app-logo i {
  color: var(--green);
  filter: drop-shadow(0 0 6px rgba(0,255,136,0.6));
  margin-right: 4px;
}

.logo-domain {
  color: var(--green);
  text-shadow: 0 0 14px rgba(0,255,136,0.6);
}

.topbar-center { flex: 1; max-width: 480px; }

#search-wrap { position: relative; }

#search-input {
  width: 100%;
  background: rgba(0,255,136,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font: inherit;
  padding: 7px 14px 7px 34px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(0,255,136,0.18);
}

#search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 0.9em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  position: relative;
  cursor: pointer;
}

/* Extends hover zone downward to bridge the gap to the dropdown */
.user-chip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  height: 16px;
}

#user-label {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(0,255,136,0.07);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.82em;
  color: var(--text-dim);
  transition: all var(--transition);
}

.user-chip:hover #user-label {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 14px rgba(0,255,136,0.22);
}

.user-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 14px);
  min-width: 180px;
  border-radius: 12px;
  overflow: visible;
  display: none;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 30px rgba(124,58,237,0.30);
  z-index: 200;
  border: 1px solid var(--border);
}


.user-chip:hover .user-dropdown,
.user-chip.open .user-dropdown { display: block; }

.user-dropdown-inner {
  border-radius: 12px;
  overflow: hidden;
}

.user-dropdown button {
  display: block; width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  font: inherit;
  transition: background var(--transition), color var(--transition);
}

.user-dropdown button i {
  margin-right: 6px;
  width: 14px;
  text-align: center;
}

.user-dropdown button:hover {
  background: var(--hover);
  color: var(--green);
}

.user-caret {
  font-size: .65em;
  margin-left: 6px;
  opacity: 0.5;
  vertical-align: middle;
  transition: transform var(--transition);
}

.user-chip:hover .user-caret { opacity: 0.9; transform: rotate(180deg); }

#btn-admin {
  color: var(--purple-bright);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

#btn-admin:hover {
  background: rgba(124,58,237,0.15) !important;
  color: #fff !important;
}

#btn-admin i {
  filter: drop-shadow(0 0 4px rgba(168,85,247,0.6));
}

/* ── SYNC STATUS ───────────────────────────────────────────────── */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75em;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(0,255,136,0.03);
  white-space: nowrap;
  min-width: 72px;
  justify-content: center;
  transition: color var(--transition), border-color var(--transition);
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.sync-indicator.ok  { color: var(--text-dim); }
.sync-indicator.err { color: var(--danger); border-color: rgba(255,68,119,0.35); }
.sync-indicator.ok   .sync-dot { background: var(--green); box-shadow: 0 0 6px rgba(0,255,136,0.70); }
.sync-indicator.busy .sync-dot { background: #ffaa00; box-shadow: 0 0 6px rgba(255,170,0,0.60); animation: pulse-sync 0.8s ease-in-out infinite; }
.sync-indicator.err  .sync-dot { background: var(--danger); box-shadow: 0 0 6px rgba(255,68,119,0.70); }

@keyframes pulse-sync {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── MAIN LAYOUT ───────────────────────────────────────────────── */
#view-app { display: flex; flex-direction: column; height: 100%; }

#main-layout {
  display: flex;
  margin-top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ── SIDEBAR ───────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  border-radius: 0;
  border-top: none; border-left: none; border-bottom: none;
  overflow: hidden;
  transition: width var(--transition), min-width var(--transition);
  background: var(--purple-dark);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: inset -1px 0 0 var(--border), 2px 0 20px rgba(124,58,237,0.12);
}

#sidebar.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
}

/* ── SIDEBAR NAV (Mail / Dashboard / Tickets) ──────────────────── */
.sidebar-nav-section {
  padding: 10px 0 4px;
  border-bottom: 1px solid rgba(0, 255, 136, 0.10);
  margin-bottom: 4px;
}

.sidebar-nav-list {
  list-style: none;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.88em;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.sidebar-nav-item i {
  width: 16px;
  text-align: center;
  font-size: 0.92em;
  color: var(--text-muted);
  transition: color var(--transition), filter var(--transition);
}

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

.sidebar-nav-item:hover i {
  color: var(--text-dim);
}

.sidebar-nav-item.active {
  background: var(--selected);
  color: var(--green);
  border-left-color: var(--green);
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.45);
  box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.07);
  font-weight: 700;
}

.sidebar-nav-item.active i {
  color: var(--green);
  filter: drop-shadow(0 0 5px rgba(0, 255, 136, 0.70));
}

/* ── SIDEBAR FOLDERS ───────────────────────────────────────────── */
.sidebar-section { padding: 16px 0; }

#sidebar-folders-section { flex: 1 1 0; min-height: 0; overflow-y: auto; }

.sidebar-label {
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0 16px 10px;
}

#folder-list { list-style: none; }

#folder-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--text-dim);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
}

#folder-list li:hover {
  background: var(--hover);
  color: var(--text);
}

#folder-list li.active {
  background: var(--selected);
  color: var(--green);
  border-left-color: var(--green);
  text-shadow: 0 0 10px rgba(0,255,136,0.4);
  box-shadow: inset 0 0 20px rgba(0,255,136,0.06);
}

.folder-icon {
  margin-right: 10px;
  width: 16px;
  text-align: center;
}

.folder-icon i {
  color: var(--text-muted);
  font-size: 0.9em;
  transition: color var(--transition), filter var(--transition);
}

#folder-list li:hover .folder-icon i { color: var(--text-dim); }

#folder-list li.active .folder-icon i {
  color: var(--green);
  filter: drop-shadow(0 0 5px rgba(0,255,136,0.70));
}

.folder-name { flex: 1; font-size: 0.9em; }

.folder-badge {
  background: var(--green);
  color: #04020e;
  font-size: 0.68em;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,255,136,0.6);
  animation: pulse-badge 2.5s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(0,255,136,0.5)); }
  50%       { filter: drop-shadow(0 0 8px rgba(0,255,136,1.0)); }
}

/* ── MESSAGE LIST ──────────────────────────────────────────────── */
#msg-list-pane {
  width: var(--list-w);
  min-width: var(--list-w);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(4, 1, 14, 0.50);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#msg-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(6, 1, 22, 0.90);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

#msg-list-title {
  font-size: 0.82em;
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 10px rgba(0,255,136,0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#msg-list-scroll { flex: 1; overflow-y: auto; }
#msg-list { list-style: none; }

#msg-list li {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,255,136,0.07);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-left-color var(--transition);
  position: relative;
  border-left: 3px solid transparent;
}

#msg-list li:hover {
  background: var(--hover);
  border-left-color: rgba(0,255,136,0.40);
  transform: translateX(2px);
}

#msg-list li.selected {
  background: var(--selected);
  border-left-color: var(--green);
  box-shadow: inset 0 0 20px rgba(0,255,136,0.06);
}

#msg-list li.unread .msg-sender,
#msg-list li.unread .msg-subject {
  font-weight: 700;
  color: var(--text);
}

#msg-list li.unread::before {
  content: '';
  position: absolute;
  left: 5px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 16px rgba(0,255,136,0.5);
}

.msg-sender {
  font-size: 0.88em;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.msg-subject {
  font-size: 0.85em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.msg-date {
  font-size: 0.72em;
  color: var(--text-muted);
}

.msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#msg-list-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

#msg-list-pagination button {
  background: rgba(0,255,136,0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.82em;
  transition: all var(--transition);
}

#msg-list-pagination button:hover {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 10px rgba(0,255,136,0.18);
}

#msg-list-pagination button.active {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 12px rgba(0,255,136,0.28);
}

/* ── READING PANE ──────────────────────────────────────────────── */
#read-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(3, 1, 10, 0.35);
}

#read-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 14px;
}

.placeholder-icon i {
  font-size: 3.5rem;
  color: rgba(0,255,136,0.18);
  filter: drop-shadow(0 0 20px rgba(0,255,136,0.25));
}

#read-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#read-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  border-left: none; border-right: none; border-top: none;
  background: rgba(8, 2, 32, 0.80);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}

#read-subject {
  font-size: 1.18em;
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 14px rgba(0,255,136,0.40);
  margin-bottom: 10px;
  line-height: 1.3;
}

#read-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 0.83em;
}

#read-meta > div { display: flex; gap: 8px; }

.meta-label {
  color: var(--text-muted);
  min-width: 36px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#read-toolbar { display: flex; gap: 4px; flex-wrap: wrap; }

#read-toolbar .icon-btn {
  font-size: 0.82em;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
}

#read-toolbar .icon-btn:hover { border-color: var(--green); }

#read-toolbar .icon-btn i { margin-right: 4px; }

#read-body-wrap {
  flex: 1;
  overflow: hidden;
  background: #fff;
}

#read-body-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

#read-attachments {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  border-radius: 0;
  flex-shrink: 0;
}

.attach-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

#attach-list { display: flex; flex-wrap: wrap; gap: 10px; }

.att-card {
  background: rgba(0,255,136,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: 148px;
  transition: border-color var(--transition), background var(--transition);
}
.att-card:hover {
  border-color: var(--border-hi);
  background: rgba(0,255,136,0.09);
}
.att-thumb {
  width: 100%;
  height: 90px;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.att-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.att-thumb-icon { font-size: 2.6em; color: var(--green-dim); }
.att-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.40);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.14s;
  color: #fff;
  font-size: 1.6em;
  pointer-events: none;
}
.att-card:hover .att-thumb-overlay { opacity: 1; }
.att-info { padding: 6px 8px 2px; }
.att-name {
  display: block;
  font-size: 0.8em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.att-size {
  display: block;
  font-size: 0.72em;
  color: var(--text-muted);
  margin-top: 2px;
}
.att-actions {
  display: flex;
  gap: 4px;
  padding: 5px 8px 7px;
  justify-content: flex-end;
}
.att-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  padding: 3px 8px;
  font-size: 0.78em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.14s;
  line-height: 1.4;
}
.att-btn:hover {
  border-color: var(--border-hi);
  color: var(--green);
  background: var(--hover);
}
/* ── Image lightbox */
#att-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#att-lightbox.open { display: flex; }
#att-lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 48px rgba(0,255,136,0.18);
  cursor: default;
}
#att-lightbox-close {
  position: absolute;
  top: 16px;
  right: 22px;
  font-size: 2em;
  color: rgba(255,255,255,0.8);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}
#att-lightbox-close:hover { color: #fff; }
#att-lightbox-dl {
  position: absolute;
  bottom: 20px;
  right: 22px;
}

/* ── COMPOSE MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(2,1,10,0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 20px 90px rgba(0,0,0,0.75),
    0 0 50px rgba(124,58,237,0.20),
    0 0 0 1px rgba(0,255,136,0.12);
  overflow: hidden;
}

.modal-box.modal-wide   { max-width: 760px; }
.modal-box.modal-narrow { max-width: 420px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(10, 2, 38, 0.96);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--green);
  font-size: 0.95em;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(0,255,136,0.4);
  flex-shrink: 0;
}

.modal-body {
  padding: 16px 18px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compose-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0,255,136,0.08);
  padding-bottom: 8px;
}

.compose-row label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  min-width: 52px;
}

.compose-row input,
.compose-row select {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92em;
  outline: none;
}

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

.compose-row select option {
  background: #0c0126;
  color: var(--text);
}

.compose-body-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}

#compose-toolbar-fmt {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  background: rgba(0,255,136,0.04);
  border-bottom: 1px solid var(--border);
}

#compose-toolbar-fmt button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.9em;
  transition: all var(--transition);
}

#compose-toolbar-fmt button:hover {
  border-color: var(--border);
  color: var(--green);
  background: var(--hover);
  box-shadow: 0 0 8px rgba(0,255,136,0.12);
}

#compose-body {
  flex: 1;
  padding: 12px 14px;
  background: rgba(0,255,136,0.02);
  color: var(--text);
  outline: none;
  font-size: 0.92em;
  line-height: 1.6;
  overflow-y: auto;
  min-height: 180px;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(6, 1, 24, 0.92);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#send-status {
  font-size: 0.82em;
  color: var(--green);
  margin-left: auto;
}

#send-status.error { color: var(--danger); }

/* ── LOADING STATE ─────────────────────────────────────────────── */
body.loading::after {
  content: '';
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 999;
}

/* ── SPINNER ───────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(0,255,136,0.15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { rotate: 360deg; } }

.spinner { will-change: transform; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88em;
}

/* ── ADMIN PANEL ───────────────────────────────────────────────── */
.admin-body {
  gap: 16px;
  max-height: 75vh;
  overflow-y: auto;
}

.glass-inner {
  background: rgba(0,255,136,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: inset 0 0 30px rgba(124,58,237,0.05);
}

.admin-section-title {
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--green);
  text-shadow: 0 0 10px rgba(0,255,136,0.40);
  margin-bottom: 14px;
  font-weight: 700;
}

.admin-section-title i { margin-right: 6px; opacity: 0.85; }

.admin-subsection {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 14px 0 10px;
}

.admin-hint {
  font-size: 0.78em;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* Quota bar */
.quota-bar-wrap { margin: 10px 0 6px; }

.quota-bar {
  height: 8px;
  background: rgba(0,255,136,0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #00aaff);
  box-shadow: 0 0 10px rgba(0,255,136,0.6);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.quota-fill.warn   { background: linear-gradient(90deg, #ffaa00, #ff6600); box-shadow: 0 0 10px rgba(255,170,0,0.5); }
.quota-fill.danger { background: linear-gradient(90deg, #ff4477, #ff0000); box-shadow: 0 0 10px rgba(255,68,119,0.5); }

.quota-label { font-size: 0.78em; color: var(--text-dim); }

/* User list */
#admin-user-list,
#admin-identity-list { margin-bottom: 4px; }

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0,255,136,0.07);
  gap: 10px;
}

.user-row:last-child { border-bottom: none; }

.user-row-email {
  flex: 1;
  font-size: 0.88em;
  color: var(--text);
}

.user-row-badge {
  font-size: 0.68em;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.user-row-badge.admin {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 8px rgba(0,255,136,0.2);
}

.user-row-actions { display: flex; gap: 6px; }

.user-row-actions button {
  font-size: 0.75em;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  transition: all var(--transition);
}

.user-row-actions button:hover    { border-color: var(--green);  color: var(--green);  box-shadow: 0 0 8px rgba(0,255,136,0.18); }
.user-row-actions button.del:hover{ border-color: var(--danger); color: var(--danger); box-shadow: 0 0 8px rgba(255,68,119,0.18); }

/* Add user/identity form */
.admin-add-form { margin-top: 4px; }

.admin-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-form-row input {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  background: rgba(0,255,136,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 0.88em;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.admin-form-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(0,255,136,0.16);
}

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

.admin-hint-gap { margin-bottom: 10px; }
.input-name-fixed { flex: 0 0 160px !important; }

/* Change-password label */
#chpass-email-label {
  color: var(--text-dim);
  margin-bottom: 12px;
  font-size: .88em;
}

/* ── DASHBOARD ──────────────────────────────────────────────────── */
#dashboard-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dash-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.dash-scroll::-webkit-scrollbar { width: 5px; }
.dash-scroll::-webkit-scrollbar-track { background: transparent; }
.dash-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.dash-widget {
  border-radius: var(--radius);
  padding: 16px 18px;
}

.dash-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dash-widget-title {
  font-size: .82em;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-scope-badge {
  font-size: .72em;
  font-weight: 500;
  color: var(--text-dim);
  background: rgba(0,255,136,0.07);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
  text-transform: none;
  letter-spacing: 0;
}

/* Storage strip */
.dash-storage-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
}

.dash-storage-strip .dash-widget-title { margin: 0; }

.dash-storage-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-storage-bar .quota-bar { flex: 1; }

/* Search row */
.dash-search-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-search-pane {
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-search-pane .dash-widget-header { margin-bottom: 0; }

.dash-search-bar-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dash-search-bar-wrap input[type=search] {
  flex: 1;
  padding: 7px 12px;
  background: rgba(0,255,136,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: .88em;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.dash-search-bar-wrap input[type=search]:focus {
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(0,255,136,0.16);
}

.dash-search-bar-wrap input[type=search]::placeholder { color: var(--text-muted); }

/* Dashboard message rows */
.dash-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  color: var(--text-dim);
  font-size: .86em;
}

.dash-empty {
  padding: 10px 0;
  color: var(--text-muted);
  font-size: .86em;
}

.dash-msg-list {
  list-style: none;
  width: 100%;
}

.dash-msg-row {
  display: grid;
  grid-template-columns: 120px 160px 140px 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-left-color var(--transition);
  border-bottom: 1px solid rgba(0,255,136,0.05);
  border-left: 3px solid transparent;
  font-size: .85em;
  color: var(--text-dim);
}

.dash-msg-row:last-child { border-bottom: none; }

.dash-msg-row:hover {
  background: var(--hover);
  border-left-color: rgba(0,255,136,0.40);
  transform: translateX(2px);
}

.dash-msg-row.selected {
  background: var(--selected);
  border-left-color: var(--green);
}

.dash-msg-row.unread { color: var(--text); font-weight: 600; }

.dash-msg-date    { color: var(--text-muted); font-size: .82em; white-space: nowrap; }
.dash-msg-from    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-msg-to      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.dash-msg-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dash read overlay */
.dash-overlay-box {
  height: 90vh;
  display: flex;
  flex-direction: column;
}

.dash-overlay-modal-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 10px;
  padding: 14px 20px 18px;
}

#dash-overlay-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-size: .85em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

#dash-overlay-meta > div {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

#dash-overlay-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-overlay-body-wrap {
  flex: 1;
  min-height: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.dash-overlay-body-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── DASHBOARD PREVIEW PANE ────────────────────────────────────── */
.dash-widget-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.dash-recent-split {
  display: flex;
  gap: 12px;
}

.dash-recent-split #dash-recent-wrap {
  flex: 1;
  min-width: 0;
}

.dash-recent-split.split-active #dash-recent-wrap {
  flex: 0 0 340px;
  max-height: 380px;
  overflow-y: auto;
}

.dash-preview-pane {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  overflow: hidden;
  min-height: 320px;
  position: relative;
}

.dash-preview-pane.hidden { display: none; }

.dash-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.88em;
  pointer-events: none;
}

.dash-preview-placeholder i {
  font-size: 2.5em;
  opacity: 0.25;
  color: var(--green);
}

#dash-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
  position: absolute;
  inset: 0;
}

#btn-dash-preview-toggle.active {
  color: var(--green);
  background: var(--hover);
  border: 1px solid var(--green);
  box-shadow: 0 0 10px rgba(0,255,136,0.20);
}

/* ── TICKETS ────────────────────────────────────────────────────── */
#tickets-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tickets-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.tickets-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tickets-filter-btns {
  display: flex;
  gap: 4px;
}

.btn-filter {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font: inherit;
  font-size: .8em;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-filter:hover {
  border-color: var(--green);
  color: var(--green);
}

.btn-filter.active {
  background: rgba(0, 255, 136, 0.12);
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}

.ticket-list-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
}

.ticket-empty { padding: 18px; }

.ticket-card {
  border-bottom: 1px solid rgba(0, 255, 136, 0.08);
}

.ticket-card:last-child { border-bottom: none; }

.ticket-header {
  display: grid;
  grid-template-columns: 42px 1fr 1fr 90px 120px 22px;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: .86em;
}

.ticket-header:hover { background: var(--hover); }

.ticket-id {
  font-size: .8em;
  font-weight: 700;
  color: var(--green-dim);
  font-variant-numeric: tabular-nums;
}

.ticket-name {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-email {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .85em;
}

.ticket-badge {
  font-size: .72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 20px;
  text-align: center;
}

.ticket-badge-open {
  background: rgba(0, 255, 136, 0.12);
  color: var(--green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.ticket-badge-archived {
  background: rgba(100, 80, 160, 0.15);
  color: var(--purple-bright);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.ticket-date {
  font-size: .78em;
  color: var(--text-muted);
  white-space: nowrap;
}

.ticket-chevron {
  color: var(--text-muted);
  font-size: .8em;
  justify-self: end;
  transition: transform var(--transition);
}

.ticket-body {
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(0, 255, 136, 0.06);
  background: rgba(0, 255, 136, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-request {
  font-size: .88em;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--green-dim);
  border-radius: 0 6px 6px 0;
}

.ticket-actions {
  display: flex;
  gap: 8px;
}

.danger-btn {
  color: var(--danger) !important;
  border-color: rgba(255, 68, 119, 0.35) !important;
}

.danger-btn:hover {
  background: rgba(255, 68, 119, 0.08) !important;
  border-color: var(--danger) !important;
  box-shadow: 0 0 8px rgba(255, 68, 119, 0.2) !important;
}

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --list-w: 260px; --sidebar-w: 180px; }
  .dash-search-row { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  #sidebar { position: fixed; left: 0; top: var(--topbar-h); bottom: 0; z-index: 50; }
  #msg-list-pane { min-width: 100%; }
  #read-pane { display: none; }
  #read-pane.mobile-show { display: flex; position: fixed; inset: var(--topbar-h) 0 0; z-index: 60; }
  .dash-msg-row { grid-template-columns: 90px 1fr; }
  .dash-msg-from, .dash-msg-to { display: none; }
}

/* ── LIGHT THEME — same dark glass panels, light body background ─── */
body.theme-light {
  /* All panel/neon vars IDENTICAL to dark theme — only body bg changes */
  --bg:           #e8e0ff;
  --glass:        rgba(8, 2, 28, 0.55);
  --glass-hi:     rgba(14, 4, 44, 0.50);
  --border:       rgba(0, 255, 136, 0.28);
  --border-hi:    rgba(0, 255, 136, 0.65);
  --green:        #00ff88;
  --green-dim:    #00cc6a;
  --green-glow:   rgba(0, 255, 136, 0.22);
  --purple:       #7c3aed;
  --purple-bright:#a855f7;
  --purple-dark:  rgba(18, 0, 52, 0.72);
  --text:         #d4ffe8;
  --text-dim:     #6abf90;
  --text-muted:   #2e5a42;
  --hover:        rgba(0, 255, 136, 0.10);
  --selected:     rgba(0, 255, 136, 0.16);
  --danger:       #ff4477;
  color: var(--text);
  /* Light body — same gradient positions, same opacities — light base instead of #04020e */
  background:
    radial-gradient(ellipse 65% 55% at 10% 0%,    rgba(124, 58, 237, 0.55) 0%, transparent 65%),
    radial-gradient(ellipse 50% 60% at 90% 100%,  rgba(0,  255, 136, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 40% 40% at 80% 10%,   rgba(124, 58, 237, 0.20) 0%, transparent 55%),
    radial-gradient(ellipse 35% 35% at 20% 90%,   rgba(0,  255, 136, 0.12) 0%, transparent 55%),
    #e8e0ff;
}
body.theme-light::before { background: none; }
body.theme-light::after  { background: none; }

/* Pane overrides: keep dark glass, just ensure backdrop-filter off so no grey blending */
body.theme-light #msg-list-pane {
  background: rgba(4, 1, 14, 0.82);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body.theme-light #read-pane {
  background: rgba(3, 1, 10, 0.78);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body.theme-light #dashboard-content,
body.theme-light .dash-scroll {
  background: transparent;
}

/* ── SETTINGS MODAL ─────────────────────────────────────────────── */
.settings-section { margin-bottom: 20px; }

.settings-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.theme-toggle-row {
  display: flex;
  gap: 10px;
}

.theme-toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--hover);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.theme-toggle-option input[type="radio"] { accent-color: var(--green); }

.theme-toggle-option:has(input:checked) {
  border-color: var(--border-hi);
  background: var(--selected);
}

.theme-toggle-icon { font-size: 1.1rem; }

#settings-signature {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.88rem;
}

#settings-save-status {
  font-size: 0.82rem;
  color: var(--green);
  min-height: 1.2em;
  margin-top: 6px;
}

/* ── MAIL CLIENT SETUP ──────────────────────────────────────────── */
.client-setup-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.client-setup-block {
  background: rgba(0, 255, 136, 0.04);
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
}

.client-setup-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.client-setup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.82rem;
  gap: 8px;
}
.client-setup-row:last-child { border-bottom: none; }

.client-setup-key {
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 70px;
}

.client-setup-val {
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  text-align: right;
  word-break: break-all;
}

.client-setup-user {
  color: var(--green);
}

/* ── RESET PASSWORD MODALS ──────────────────────────────────────── */
#reset-link-box {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

#reset-link-box input {
  flex: 1;
  font-size: 0.80rem;
  padding: 6px 8px;
}

#reset-link-box .btn-ghost { white-space: nowrap; }

/* ── AUTO-REPLY ADMIN SECTION ───────────────────────────────────── */
.ar-enabled-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px; height: 22px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute; inset: 0;
  background: var(--text-muted);
  border-radius: 22px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

#ar-save-status {
  font-size: 0.82rem;
  color: var(--green);
  min-height: 1.2em;
  margin-top: 6px;
}

/* ── THUMBNAIL ATTACHMENT CARDS ─────────────────────────────────── */
.attach-card-img {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: rgba(0,0,0,0.25);
}

.attach-thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition);
}

.attach-card-img::after {
  content: '\f00e';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.attach-card:hover .attach-card-img::after { opacity: 1; }

/* ── COMPOSE FROM ROW (hidden for single-identity users) ────────── */
#compose-from-row { transition: opacity var(--transition); }

/* ── ADMIN AUTO-REPLY SECTION ───────────────────────────────────── */
.admin-form-col { margin-bottom: 12px; }
.ar-field { margin-bottom: 10px; }
.ar-body-textarea {
  width: 100%; resize: vertical;
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 8px 10px; font: inherit; font-size: .88rem;
}
.ar-actions-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── MODAL UTILITY CLASSES ──────────────────────────────────────── */
.modal-hint { margin-bottom: 10px; font-size: .88rem; color: var(--text-dim); }
.modal-status-line { font-size: .82rem; color: var(--green); min-height: 1.2em; margin-top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── AUTO-REPLY IDENTITY CARDS ──────────────────────────────────── */
.ar-identity-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--hover);
}

.ar-identity-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ar-identity-addr {
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-all;
}

/* ── SHARED FILES PANEL ─────────────────────────────────────────── */
#shared-panel {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: rgba(6, 3, 20, 0.5);
}

.shared-panel-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 5px;
  font-size: 0.73em;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.shared-panel-head span { flex: 1; }
.shared-panel-head .icon-btn { padding: 2px 4px; font-size: 0.85em; opacity: 0.6; }
.shared-panel-head .icon-btn:hover { opacity: 1; }

.shared-drop-zone {
  margin: 0 10px 6px;
  border: 1px dashed rgba(0,255,136,0.22);
  border-radius: 6px;
  padding: 7px 8px;
  text-align: center;
  font-size: 0.72em;
  color: var(--text-muted);
  cursor: default;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  -webkit-user-select: none;
  user-select: none;
}
.shared-drop-zone i { display: block; font-size: 1.1em; margin-bottom: 2px; opacity: 0.6; }
.shared-drop-zone.drag-over {
  border-color: var(--green);
  background: rgba(0,255,136,0.07);
  color: var(--green);
}
.shared-drop-zone.drag-over i { opacity: 1; }

.shared-file-tree {
  max-height: 190px;
  overflow-y: auto;
  padding: 0 6px 6px;
}

.shared-folder { margin-bottom: 2px; }

.shared-folder-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px;
  font-size: 0.74em;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition);
  -webkit-user-select: none;
  user-select: none;
}
.shared-folder-head:hover { background: rgba(0,255,136,0.06); }
.shared-folder-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shared-file-list { list-style: none; padding-left: 12px; }

.shared-file-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 2px;
  border-radius: 3px;
}
.shared-file-item:hover { background: rgba(0,255,136,0.04); }

.shared-file-icon { font-size: 0.68em; color: var(--text-muted); flex-shrink: 0; }

.shared-file-name {
  flex: 1;
  font-size: 0.71em;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shared-file-name:hover { color: var(--green); text-decoration: underline; }

.shared-file-size {
  font-size: 0.65em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.shared-del-btn {
  padding: 1px 3px;
  font-size: 0.68em;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}
.shared-folder-head:hover .shared-del-btn,
.shared-file-item:hover   .shared-del-btn { opacity: 0.55; }
.shared-del-btn:hover { opacity: 1 !important; color: var(--danger); }

.shared-upload-status {
  padding: 3px 10px 5px;
  font-size: 0.7em;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shared-upload-status.hidden { display: none; }
.shared-upload-status.status-ok   { color: var(--green); }
.shared-upload-status.status-err  { color: var(--danger); }
.shared-upload-status.status-warn { color: #e6a817; }

.shared-empty {
  display: block;
  padding: 8px 6px;
  font-size: 0.72em;
  color: var(--text-muted);
  text-align: center;
}

/* light theme — matches neon glass light palette */
body.theme-light #shared-panel      { background: rgba(235, 230, 255, 0.55); border-top-color: var(--border); }
body.theme-light .shared-panel-head { color: var(--text-dim); }
body.theme-light .shared-drop-zone  { border-color: rgba(0, 170, 85, 0.28); color: var(--text-muted); }
body.theme-light .shared-drop-zone.drag-over { border-color: var(--green); background: rgba(0,170,85,0.07); color: var(--green); }
body.theme-light .shared-folder-head       { color: var(--text-dim); }
body.theme-light .shared-folder-head:hover { background: var(--hover); }
body.theme-light .shared-file-name         { color: var(--text-dim); }
body.theme-light .shared-file-name:hover   { color: var(--green); }
body.theme-light .shared-file-size         { color: var(--text-muted); }
body.theme-light .shared-empty             { color: var(--text-muted); }
