/* ==========================================================================
   Axiom Webmail CSS System & Themes (Dark, Light, Cyberpunk)
   Clean, modern enterprise styling for full webmail experience.
   ========================================================================== */

/* SLEEK OBSIDIAN / CHARCOAL BLACK THEME */
:root,
[data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --bg-sidebar: #0f172a;
  --bg-input: #1e293b;
  --border-color: #334155;
  --border-color-focus: #3b82f6;

  --accent-primary: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --accent-hover: #2563eb;
  --danger: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-main: 0 16px 36px -8px rgba(0, 0, 0, 0.7);
}

/* LIGHT MODERN THEME */
[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-sidebar: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-color-focus: #2563eb;

  --accent-primary: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --accent-hover: #4338ca;
  --danger: #dc2626;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --shadow-main: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* CYBERPUNK NEON THEME */
[data-theme="cyberpunk"] {
  --bg-main: #0c0817;
  --bg-card: #150f28;
  --bg-card-hover: #21163d;
  --bg-sidebar: #100a20;
  --bg-input: #181030;
  --border-color: rgba(236, 72, 153, 0.3);
  --border-color-focus: #ec4899;

  --accent-primary: #ec4899;
  --accent-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  --accent-hover: #db2777;
  --danger: #f43f5e;

  --text-main: #ffffff;
  --text-muted: #f5d0fe;
  --text-dim: #d8b4fe;
  --shadow-main: 0 0 25px rgba(236, 72, 153, 0.25);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.login-active {
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim) !important;
  opacity: 0.85;
}

/* ==========================================================================
   MODERN SPLIT-SCREEN ENTERPRISE LOGIN SYSTEM (ZERO-SCROLL COMPACT)
   ========================================================================== */

.login-layout {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
}

/* Top Anchored Header Bar */
.login-top-bar {
  position: relative;
  width: 100%;
  height: 52px;
  flex-shrink: 0;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .login-top-bar {
  background: var(--bg-card);
  border-bottom-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

/* Left group: monogram + wordmark + status */
.login-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Brand monogram icon wrapper */
.login-brand-mark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

[data-theme="cyberpunk"] .login-brand-mark rect {
  fill: #ec4899;
}

/* Brand wordmark next to icon */
.login-brand-wordmark {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin-right: 0.4rem;
}

.login-top-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  background: rgba(16, 185, 129, 0.08);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.theme-switcher-single {
  display: flex;
  align-items: center;
}

.theme-cycle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.theme-cycle-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
  transform: scale(1.05);
}

[data-theme="dark"] .theme-cycle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="cyberpunk"] .theme-cycle-btn:hover {
  background: rgba(236, 72, 153, 0.15);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.35);
  border-color: rgba(236, 72, 153, 0.35);
}

.theme-cycle-svg {
  width: 18px;
  height: 18px;
}

/* Split Layout Container */
.login-split-container {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background-color: var(--bg-main);
}

.login-split-container.layout-reversed {
  flex-direction: row-reverse;
}

/* ILLUSTRATION / HERO PANE */
.login-hero-pane {
  flex: 1.2;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background: transparent;
  overflow: hidden;
}

.hero-illustration-wrapper {
  width: 100%;
  max-width: 450px;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
}

.hero-img {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  transition: filter 0.3s ease;
}

[data-theme="dark"] .hero-img {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.15)) saturate(0.65) brightness(0.9);
}

[data-theme="light"] .hero-img {
  filter: saturate(0.55) brightness(1.05);
}

[data-theme="cyberpunk"] .hero-img {
  filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.6)) drop-shadow(0 0 20px rgba(139, 92, 246, 0.4));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 500px;
  text-align: center;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.brand-title-centered {
  text-align: center;
  margin-bottom: 0.5rem;
}

.brand-blue {
  color: #4f46e5;
}

[data-theme="cyberpunk"] .brand-blue {
  color: #ec4899;
}

.brand-dark {
  color: #111827;
}

[data-theme="dark"] .brand-dark {
  color: #f3f4f6;
}

[data-theme="cyberpunk"] .brand-dark {
  color: #e4e4e7;
}

.hero-tagline {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .hero-tagline {
  color: #e5e7eb;
}

[data-theme="cyberpunk"] .hero-tagline {
  color: #f4f4f5;
}

.hero-description {
  color: #4b5563;
  font-size: 0.885rem;
  line-height: 1.45;
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .hero-description {
  color: #9ca3af;
}

[data-theme="cyberpunk"] .hero-description {
  color: #a1a1aa;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.feature-list.horizontal-features {
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.horizontal-features .feature-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 150px;
  gap: 0.5rem;
}

.feature-icon-wrapper {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: #ffffff;
  border: 1px solid #dbeafe;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4f46e5;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .feature-icon-wrapper {
  background-color: #12141c;
  border-color: rgba(255, 255, 255, 0.1);
  color: #3b82f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="cyberpunk"] .feature-icon-wrapper {
  background-color: #1c102b;
  border-color: rgba(236, 72, 153, 0.3);
  color: #ec4899;
}

.feature-card:hover .feature-icon-wrapper {
  transform: translateY(-2px);
}

.feature-svg {
  width: 20px;
  height: 20px;
}

.feature-text h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.1rem;
}

[data-theme="dark"] .feature-text h3 {
  color: #f9fafb;
}

[data-theme="cyberpunk"] .feature-text h3 {
  color: #fafafa;
}

.feature-text p {
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.35;
}

[data-theme="dark"] .feature-text p {
  color: #9ca3af;
}

[data-theme="cyberpunk"] .feature-text p {
  color: #a1a1aa;
}

/* RIGHT LOGIN FORM PANE (now left if layout-reversed) */
.login-form-pane {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background-color: var(--bg-main);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.login-card-solid {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  padding: 1.25rem 2.2rem 1.25rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 12px 32px -4px rgba(0, 0, 0, 0.08),
    0 24px 60px -12px rgba(26, 86, 219, 0.08);
  animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .login-card-solid {
  background: rgba(18, 20, 28, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 4px 10px -2px rgba(0, 0, 0, 0.4),
    0 16px 40px -6px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="cyberpunk"] .login-card-solid {
  background: rgba(24, 24, 27, 0.9);
  backdrop-filter: blur(16px);
  border-color: rgba(236, 72, 153, 0.3);
  box-shadow:
    0 0 20px rgba(236, 72, 153, 0.15),
    0 16px 40px -8px rgba(0, 0, 0, 0.6);
}

.login-card-header {
  text-align: center;
  margin-bottom: 18px;
}

.welcome-heading {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.welcome-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Form inputs with left icons */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group-custom {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-custom label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

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

.field-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-icon-wrapper input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem 0.65rem 2.35rem;
  background-color: var(--bg-input);
  border: 2px solid var(--border-color); /* Integer px — no sub-pixel layout shift */
  border-radius: 8px;
  font-size: 16px; /* >= 16px prevents mobile browser auto-zoom on focus */
  font-family: inherit;
  color: var(--text-main);
  touch-action: manipulation;
  /* Reserve shadow ring space so focus glow never shifts layout */
  box-shadow: 0 0 0 3px transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-icon-wrapper input:focus {
  outline: none;
  border-color: var(--border-color-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .input-icon-wrapper input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.input-icon-wrapper input:focus~.field-icon,
.input-icon-wrapper:focus-within .field-icon {
  color: var(--border-color-focus);
}

[data-theme="cyberpunk"] .input-icon-wrapper input:focus {
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.25), 0 0 8px rgba(236, 72, 153, 0.15);
}

[data-theme="cyberpunk"] .input-icon-wrapper:focus-within .field-icon {
  color: #ec4899;
}

.btn-password-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.btn-password-toggle:hover {
  color: var(--text-main);
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-password-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.eye-svg {
  width: 18px;
  height: 18px;
}

/* Options / Checkbox */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #4f46e5;
  cursor: pointer;
  border-radius: 3px;
}

.checkbox-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* IT Support hint below password field */
.it-support-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: -8px;
}

.it-support-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--text-dim);
}

.it-support-link {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.it-support-link:hover {
  color: #1e429f;
  text-decoration: underline;
}

[data-theme="cyberpunk"] .it-support-link {
  color: #ec4899;
}

[data-theme="cyberpunk"] .it-support-link:hover {
  color: #db2777;
}

/* Primary Action Button */
.btn-primary-blue {
  width: 100%;
  padding: 0.7rem 1.25rem;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.22);
  transition: all 0.2s ease;
}

.btn-primary-blue:hover:not(:disabled) {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-primary-blue:active:not(:disabled),
.btn-primary-blue.btn-mousedown {
  transform: scale(0.98) translateY(0);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
  background: #3730a3;
}

.btn-primary-blue:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Loading state — JS adds this class on submit */
.btn-primary-blue.btn-loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
}

.btn-primary-blue.btn-loading .btn-text {
  opacity: 0.8;
}

[data-theme="cyberpunk"] .btn-primary-blue {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  box-shadow: 0 3px 12px rgba(236, 72, 153, 0.25);
}

[data-theme="cyberpunk"] .btn-primary-blue:hover:not(:disabled) {
  opacity: 0.95;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 16px 0 8px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.divider-text {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: lowercase;
}

/* Admin portals ghost-style links (low visual weight) */
.admin-portals-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portals-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.portals-list {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* Ghost / text-link style admin portal links */
.portal-ghost-link {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(226, 232, 240, 0.8));
  background: rgba(0, 0, 0, 0.02);
  transition: all 0.18s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.portal-ghost-link:hover {
  color: #1a56db;
  border-color: rgba(26, 86, 219, 0.3);
  background: rgba(26, 86, 219, 0.05);
}

[data-theme="cyberpunk"] .portal-ghost-link:hover {
  color: #ec4899;
  border-color: rgba(236, 72, 153, 0.3);
  background: rgba(236, 72, 153, 0.05);
}

.portal-ghost-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  flex-shrink: 0;
}

.portal-ghost-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  transition: transform 0.18s ease, opacity 0.18s ease;
  flex-shrink: 0;
}

.portal-ghost-link:hover .portal-ghost-chevron {
  transform: translateX(2px);
  opacity: 0.9;
}

/* Separator dot removed when links are card buttons */
.portals-list .portal-ghost-link:not(:last-child)::after {
  display: none !important;
}

/* Error alert in login */
.alert-error {
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
}

/* Footer note */
.login-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.6;
  padding-bottom: 4px;
}

/* Spinner */
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* Shake animation for wrong-password field */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  15% {
    transform: translateX(-6px);
  }

  30% {
    transform: translateX(6px);
  }

  45% {
    transform: translateX(-5px);
  }

  60% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-3px);
  }

  90% {
    transform: translateX(3px);
  }
}

.input-shake {
  animation: shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Field-level error text below input */
.field-error-text {
  font-size: 0.72rem;
  color: #ef4444;
  margin-top: 3px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-brand-header {
  display: none;
}

/* Responsive Split Layout (Tablets) */
@media (max-width: 960px) {
  .login-layout {
    overflow-y: auto;
  }

  .login-split-container,
  .login-split-container.layout-reversed {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .login-hero-pane {
    padding: 3.5rem 1.5rem 1.5rem;
    flex: auto;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
  }

  .feature-list {
    display: none;
  }

  .login-form-pane {
    padding: 1rem 1.25rem 2.5rem;
  }

  .login-card-solid {
    padding: 1.5rem 1.25rem;
  }
}

/* Mobile Screen Layout (<= 768px): Dedicated Clean Mobile Sign-In Experience */
@media (max-width: 768px) {
  html, body, body.login-active {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  body.app-active {
    height: 100% !important;
    overflow: hidden !important;
  }

  .login-layout {
    position: relative !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100dvh !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background-color: var(--bg-main) !important;
    padding-bottom: 3rem !important;
    box-sizing: border-box !important;
  }

  .login-split-container,
  .login-split-container.layout-reversed {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  /* Vertically stacked hero template */
  .login-hero-pane {
    order: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 2.25rem 1.25rem 0.5rem !important;
    box-sizing: border-box !important;
    flex: none !important;
  }

  .login-hero-pane .hero-content {
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .login-hero-pane .hero-brand-overlay {
    position: static !important;
    margin-bottom: 0.5rem !important;
  }

  .login-hero-pane .hero-illustration-wrapper {
    margin: 0.25rem 0 0.5rem !important;
    max-width: 170px !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  .login-hero-pane .hero-img {
    max-width: 160px !important;
    max-height: 130px !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .login-hero-pane .hero-tagline {
    font-size: 1.15rem !important;
    margin: 0.35rem 0 0.2rem !important;
    text-align: center !important;
    font-weight: 700 !important;
  }

  .login-hero-pane .hero-description {
    font-size: 0.85rem !important;
    margin: 0 0 0.5rem !important;
    text-align: center !important;
    color: var(--text-muted, #64748b) !important;
    max-width: 290px !important;
  }

  .login-hero-pane .feature-list {
    display: none !important;
  }

  .login-form-pane {
    order: 2 !important;
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.5rem 1.25rem 3rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .login-card-solid {
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    border-radius: 20px !important;
    padding: 1.75rem 1.35rem 1.5rem !important;
    box-sizing: border-box !important;
  }

  /* Show neat brand logo inside card on mobile */
  .mobile-brand-header {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
  }

  .mobile-brand-icon {
    width: 28px;
    height: 28px;
    color: #4f46e5;
  }

  .mobile-brand-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .mobile-brand-text .brand-blue {
    color: #1a56db;
  }

  .mobile-brand-text .brand-dark {
    color: var(--text-main, #0f172a);
  }

  .welcome-heading {
    font-size: 1.45rem !important;
    margin-bottom: 0.15rem !important;
  }

  .welcome-sub {
    font-size: 0.825rem !important;
  }

  .form-group-custom input {
    font-size: 16px !important;
    height: 46px !important;
  }

  .btn-primary-blue {
    height: 48px !important;
    font-size: 0.95rem !important;
  }

  .page-theme-toggle {
    top: 14px !important;
    right: 14px !important;
    z-index: 100 !important;
  }

  /* Admin portal links stacked vertically on mobile */
  .portals-list {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .portal-ghost-link {
    width: 100% !important;
    flex: none !important;
    justify-content: flex-start !important;
    padding: 0.65rem 0.85rem !important;
    font-size: 0.825rem !important;
    box-sizing: border-box !important;
  }

  .portal-ghost-chevron {
    margin-left: auto !important;
  }
}

.btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.btn-primary {
  width: 100%;
  background: var(--accent-gradient);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  opacity: 0.9;
}

.admin-login-links {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.admin-login-links p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.admin-link-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-admin-link {
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  display: block;
  transition: all 0.2s ease;
}

.btn-admin-link:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-primary);
  color: var(--text-main);
}

.alert-error {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.85rem;
  text-align: center;
}

/* DASHBOARD MAIN LAYOUT */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  height: 60px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.nav-brand-title {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-selector select {
  padding: 0.35rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dashboard {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-compose {
  width: 100%;
  background: var(--accent-gradient);
  color: white;
}

.mailbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mailbox-item,
.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.mailbox-item:hover,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.mailbox-item.active,
.nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  font-weight: 600;
}

.mailbox-item .name-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mailbox-item .icon {
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge {
  background: var(--accent-primary);
  color: white;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* EMAIL LIST PANE */
.email-list-pane {
  width: 380px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.pane-header h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
}

.btn-small {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.15);
}

.search-box {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.search-box input {
  width: 100%;
  padding: 0.5rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
}

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

.email-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
}

.email-item:hover {
  background: var(--bg-card-hover);
}

.email-item.active {
  background: rgba(59, 130, 246, 0.15);
  border-left: 3px solid var(--accent-primary);
}

.email-item.unread {
  font-weight: 600;
}

.email-item.unread .email-subject {
  color: var(--text-main);
}

.email-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}

.email-sender {
  color: var(--text-main);
  font-weight: 600;
}

.email-date {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.email-subject {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-snippet {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* EMAIL DETAIL PANE & ISOLATED IFRAME FOR HTML SIGNATURES */
.email-detail-pane {
  flex: 1;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
}

.empty-state-large h2 {
  color: var(--text-main) !important;
}

.empty-state-large p {
  color: var(--text-muted) !important;
}

.empty-icon-box {
  background: var(--bg-card-hover, #eef2ff) !important;
  border: 1px solid var(--border-color, transparent) !important;
}

.empty-icon-box i,
.empty-icon-box svg {
  color: var(--accent-primary, #4f46e5) !important;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.email-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-toolbar {
  display: flex;
  gap: 0.75rem;
}

.detail-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.detail-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.date-tag {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.detail-body {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-main);
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* Isolated iframe for rendering Outlook/Gmail signatures & HTML emails pixel-perfect */
.email-iframe {
  width: 100%;
  min-height: 480px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-main);
  transition: all 0.2s ease;
}

/* ATTACHMENTS DISPLAY IN READER PANE (PLACED AT START OF MESSAGE) */
.attachments-section {
  margin: 0 0 1rem 0;
  padding: 10px 14px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

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

.attachment-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.15s ease;
  position: relative;
}

.attachment-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.att-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.att-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.att-name {
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-size {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.att-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 2px;
  text-decoration: none;
}

.att-download-btn:hover {
  color: var(--accent-primary);
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.2);
}

/* MODAL & FILE UPLOAD ATTACHMENTS IN COMPOSE */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-card {
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-main);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.file-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.file-dropzone p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.attached-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid var(--border-color-focus);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-main);
}

.file-chip-remove {
  background: transparent;
  border: none;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ==========================================================================
   OUTLOOK-STYLE INLINE COMPOSER & ADVANCED MAILBOX STYLES
   ========================================================================== */

/* Navbar Portal Links */
.nav-portal-link {
  font-size: 0.8rem;
  color: var(--accent-primary);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-portal-link:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Pane Header Actions & Sort Toggle */
.pane-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sort {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.btn-sort:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--accent-primary);
}

/* Sidebar Mailbox Storage Utilization Widget */
.sidebar-storage {
  margin-top: auto;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
}

.storage-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.storage-title {
  color: var(--text-muted);
  font-weight: 600;
}

.storage-text {
  color: var(--text-dim);
}

.storage-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.storage-progress {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* OUTLOOK-STYLE INLINE COMPOSER */
.compose-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-main);
  padding: 1.5rem;
  gap: 1rem;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.compose-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.ribbon-left,
.ribbon-right {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.btn-outline {
  background: transparent !important;
  border: 1px solid var(--danger) !important;
  color: var(--danger) !important;
}

.btn-outline:hover {
  background: var(--danger) !important;
  color: #ffffff !important;
}

.compose-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0;
}

.compose-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.compose-row label {
  width: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.compose-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  padding: 0.4rem 0;
}

.compose-row input:focus {
  color: var(--text-main);
}

.recipient-pills {
  display: flex;
  gap: 0.35rem;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.compose-body-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.compose-body-wrapper textarea {
  flex: 1;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  min-height: 250px;
  transition: border-color 0.2s ease;
}

.compose-body-wrapper textarea:focus {
  border-color: var(--accent-primary);
}

/* SETTINGS MODAL & TABS */
.settings-card {
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.settings-tab-content {
  flex: 1;
  overflow-y: auto;
  max-height: calc(88vh - 170px);
  padding-right: 8px;
  padding-bottom: 0.75rem;
}

.settings-tab-content::-webkit-scrollbar {
  width: 6px;
}

.settings-tab-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.settings-tab-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.settings-tab-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.settings-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.settings-saved-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

.setting-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.setting-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
}

.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
}

.setting-row-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}

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

.signature-templates {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-chip:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.signature-preview {
  margin-top: 0.4rem;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  min-height: 60px;
  line-height: 1.4;
}

/* Autocomplete Suggestions Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 60px;
  right: 10px;
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--bg-card-hover);
}

.autocomplete-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.autocomplete-info {
  display: flex;
  flex-direction: column;
}

.autocomplete-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.autocomplete-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   OUTLOOK FLOATING MINI FORMATTING TOOLBAR & RICH TEXT COMPOSER
   ========================================================================== */
.compose-body-editor {
  min-height: 320px;
  max-height: 650px;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  font-family: 'Aptos', 'Calibri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main) !important;
  background: var(--bg-card) !important;
  outline: none;
  cursor: text;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.compose-body-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  cursor: text;
}

/* Excel & HTML Table Borders & Styling */
.compose-body-editor table,
.email-content-body table,
.email-detail-body table {
  border-collapse: collapse !important;
  margin: 12px 0 !important;
  width: auto;
  max-width: 100%;
}

.compose-body-editor th,
.compose-body-editor td,
.email-content-body th,
.email-content-body td,
.email-detail-body th,
.email-detail-body td {
  border: 1px solid var(--border-color) !important;
  padding: 8px 14px !important;
  text-align: left;
  vertical-align: middle;
  min-width: 40px;
}

.compose-body-editor th,
.email-content-body th,
.email-detail-body th {
  background-color: var(--bg-card-hover) !important;
  font-weight: 600;
  color: var(--text-main) !important;
}

.compose-body-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

/* Floating Mini Toolbar */
.mini-formatting-toolbar {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  backdrop-filter: blur(12px);
  transform: translateY(-8px);
  animation: miniToolbarFadeIn 0.15s ease-out forwards;
}

@keyframes miniToolbarFadeIn {
  from {
    opacity: 0;
    transform: translateY(0);
  }

  to {
    opacity: 1;
    transform: translateY(-8px);
  }
}

.fmt-select {
  height: 28px;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
  padding: 0 4px;
  cursor: pointer;
}

.fmt-select-sm {
  width: 52px;
}

.fmt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-main);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  position: relative;
}

.fmt-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}

.fmt-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  font-weight: 700;
}

.fmt-divider {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--border-color);
  margin: 0 2px;
}

.fmt-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.fmt-color-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.fmt-icon {
  font-size: 12px;
  line-height: 1;
}

.fmt-color-indicator {
  width: 14px;
  height: 3px;
  border-radius: 1px;
}

.fmt-color-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow-main);
  z-index: 1060;
}

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s ease;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.color-swatch:hover {
  transform: scale(1.2);
}

.fmt-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow-main);
  z-index: 1060;
  min-width: 80px;
  overflow: hidden;
}

.fmt-menu-item {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.fmt-menu-item:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}

/* Draft Status Badge */
.draft-status-badge {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: 0.75rem;
  font-style: italic;
}

/* ==========================================================================
   MULTI-SIGNATURE MANAGER STYLES (OUTLOOK STYLE)
   ========================================================================== */
.sig-manager-header {
  margin-bottom: 1rem;
}

.sig-select-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
  align-items: center;
}

.sig-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.btn-sig-fmt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-main);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-sig-fmt:hover {
  background: var(--bg-card);
  border-color: var(--border-color);
}

.btn-sig-upload {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-sig-upload:hover {
  opacity: 0.9;
}

.sig-paste-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: auto;
}

.signature-editor-body {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
}

.signature-editor-body:empty:before {
  content: attr(data-placeholder);
  color: var(--text-dim);
}

.signature-editor-body img {
  max-width: 180px;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-top: 6px;
}

/* Signature Placement Rules Card */
.sig-rules-card {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.sig-rules-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.sig-rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sig-rule-col label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: block;
}

.sig-rules-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.setting-check-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}

.sig-save-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.sig-saved-text {
  font-size: 0.85rem;
  color: #10b981;
  font-weight: 600;
}

/* Outlook-style Refresh Spin Animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-small-square.spinning svg,
.btn-icon.spinning svg {
  animation: spin 0.6s linear infinite;
}

/* ==========================================================================
   User Profile Dropdown
   ========================================================================== */
.user-profile-wrapper {
  position: relative;
}

.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  z-index: 1050;
  animation: profileDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes profileDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.profile-dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #4f46e5;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.profile-dropdown-info {
  overflow: hidden;
  flex: 1;
}

.profile-dropdown-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-email {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.profile-dropdown-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #4f46e5;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 9999px;
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border-color, #e2e8f0);
  margin: 0.85rem 0 0.5rem;
}

.profile-dropdown-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-md, 8px);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main, #1e293b);
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.profile-dropdown-item:hover {
  background: rgba(79, 70, 229, 0.08);
}

.profile-dropdown-item.logout-item:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* ==========================================================================
   Multi-Select Batch Action Bar
   ========================================================================== */
.batch-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.85rem;
  min-height: 40px;
}

.batch-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.batch-select-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main, #334155);
  user-select: none;
}

.email-master-checkbox,
.email-row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #4f46e5;
  border-radius: 3px;
}

.email-row-checkbox {
  margin-top: 2px;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.btn-batch-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm, 6px);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-batch-delete:hover {
  background: #fecaca;
  color: #b91c1c;
}

.email-item {
  display: flex !important;
  align-items: flex-start !important;
}

.email-item.selected {
  background: rgba(79, 70, 229, 0.08) !important;
}

.email-item-checkbox-wrapper {
  padding-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.email-item-content {
  flex: 1;
  min-width: 0;
}

/* ==========================================================================
   Mobile Responsive Styles (<= 768px)
   ========================================================================== */
.mobile-menu-btn {
  display: none;
}

.mobile-only-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
  }

  .mobile-only-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .navbar {
    padding: 0.5rem 0.75rem;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
  }

  .nav-brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    line-height: 1 !important;
  }

  .nav-brand span,
  .nav-brand .nav-brand-title {
    font-size: 1.05rem !important;
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: middle !important;
  }

  .nav-portal-link {
    display: none; /* Accessed via profile dropdown on mobile */
  }

  #userEmailDisplay {
    display: none; /* Keep clean avatar circle on mobile navbar */
  }

  .dashboard {
    position: relative;
    overflow: hidden;
  }

  /* Off-Canvas Sidebar Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px !important;
    height: 100vh;
    z-index: 999;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    background: #ffffff;
    padding-top: 1.5rem;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Full Width Panes */
  .email-list-pane {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 100%;
    border-right: none;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .pane-header {
    padding: 10px 14px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .pane-header h2 {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
  }

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

  .btn-sort {
    padding: 6px 8px !important;
    height: 32px !important;
    box-sizing: border-box !important;
  }

  .btn-sort #sortBtnText {
    display: none !important;
  }

  .btn-sort i {
    margin-right: 0 !important;
  }

  .btn-small-square {
    width: 32px !important;
    height: 32px !important;
    box-sizing: border-box !important;
  }

  .search-box-row {
    padding: 0 14px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    gap: 8px !important;
  }

  .search-input-wrapper {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .search-input-wrapper input {
    width: 100% !important;
    height: 38px !important;
    box-sizing: border-box !important;
    font-size: 13.5px !important;
  }

  .btn-filter {
    width: 38px !important;
    height: 38px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }

  .batch-action-bar {
    padding: 8px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .email-items {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    padding-bottom: 80px !important;
  }

  .email-item {
    padding: 10px 14px !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Outlook Mobile Reading View */
  .email-detail-pane {
    position: fixed;
    top: 54px; /* Below navbar */
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: calc(100dvh - 54px) !important;
    z-index: 50;
    background: var(--bg-main) !important;
    overflow-y: auto;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box !important;
  }

  .email-detail-pane.mobile-hidden {
    display: none !important;
  }

  .detail-toolbar {
    padding: 8px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .detail-toolbar #replyBtn,
  .detail-toolbar #replyAllBtn,
  .detail-toolbar #forwardBtn {
    display: none !important;
  }

  .detail-toolbar #deleteBtn {
    display: inline-flex !important;
    margin-left: auto !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
  }

  .detail-header {
    padding: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .detail-header h2 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin: 0 0 10px !important;
    line-height: 1.3 !important;
  }

  .email-content {
    padding-bottom: 75px !important;
  }

  .email-iframe {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Outlook Mobile Docked Bottom Action Bar */
  .mobile-reading-bottom-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 10px 14px !important;
    gap: 8px !important;
    z-index: 60 !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.15) !important;
    box-sizing: border-box !important;
  }

  .mobile-reading-btn {
    flex: 1 1 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 42px !important;
    border-radius: 21px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card-hover) !important;
    color: var(--text-main) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    padding: 0 4px !important;
    white-space: nowrap !important;
  }

  .mobile-reading-btn:active {
    background: var(--border-color) !important;
    transform: scale(0.98) !important;
  }

  /* Outlook Mobile Floating Action Button (FAB) */
  .mobile-fab-compose {
    display: flex !important;
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 54px !important;
    height: 54px !important;
    border-radius: 27px !important;
    background: var(--accent-gradient) !important;
    color: #ffffff !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    z-index: 45 !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
  }

  .mobile-fab-compose:active {
    transform: scale(0.92) !important;
  }

  /* Outlook Mobile Style Full Screen Composer */
  .compose-pane {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    z-index: 1002 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    background: var(--bg-card) !important;
  }

  .compose-ribbon {
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    height: 52px !important;
  }

  .compose-ribbon .ribbon-left {
    order: 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .compose-ribbon .ribbon-right {
    order: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  #inlineSaveDraftBtn {
    display: none !important;
  }

  #mobileCloseComposerBtn {
    display: inline-flex !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-main) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 6px 4px !important;
  }

  #inlineAttachBtn {
    padding: 6px 10px !important;
    font-size: 13px !important;
  }

  #inlineSendBtn {
    padding: 6px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 20px !important;
  }

  .compose-fields {
    padding: 4px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .compose-row:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 0 !important;
  }

  .compose-body-wrapper {
    padding: 10px 14px 24px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  .compose-body-editor {
    font-size: 15px !important;
    padding: 0 0 16px 0 !important;
    flex: 1 !important;
    min-height: 250px !important;
  }
  .compose-body-editor > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .user-profile-dropdown {
    right: 8px;
    width: calc(100vw - 32px);
    max-width: 310px;
  }

  /* Settings Modal Responsive */
  .modal-overlay {
    padding: 12px !important;
  }

  .modal-card.settings-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }

  .settings-tabs {
    width: 100% !important;
    display: flex !important;
    gap: 4px !important;
    box-sizing: border-box !important;
  }

  .settings-tabs .tab-btn {
    flex: 1 1 50% !important;
    padding: 8px 6px !important;
    font-size: 0.825rem !important;
    white-space: nowrap !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .modal-footer {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .modal-footer .btn {
    flex: 1 1 50% !important;
    padding: 8px !important;
    font-size: 0.85rem !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  /* Signature Settings Modal Vertical Layout (No Congestion) */
  .sig-select-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .sig-btn-group {
    display: flex !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .sig-btn-group .btn {
    flex: 1 !important;
    justify-content: center !important;
    font-size: 12px !important;
    padding: 6px 4px !important;
  }

  .sig-editor-toolbar {
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 6px !important;
  }

  .sig-paste-hint {
    display: none !important;
  }

  .sig-rules-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .sig-rules-toggles {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .sig-save-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .sig-save-row .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   Email Security Banners (External Sender / Phishing / Impersonation Alert)
   ========================================================================== */
.email-security-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.email-security-banner.hidden {
  display: none !important;
}

.email-security-banner .security-banner-icon {
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-security-banner .security-banner-content {
  flex: 1;
  min-width: 0;
}

.email-security-banner .security-banner-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.email-security-banner .security-banner-desc {
  font-size: 12px;
  margin: 0;
}

.email-security-banner .security-banner-list {
  margin: 6px 0 0 16px;
  padding: 0;
  font-size: 12px;
}

.email-security-banner .security-banner-list li {
  margin-bottom: 3px;
}

/* 1. External Sender notice (Blue / Slate neutral notification) */
.email-security-banner.external {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}
.email-security-banner.external .security-banner-title {
  color: #0284c7;
}
.email-security-banner.external .security-banner-desc {
  color: #0c4a6e;
}

[data-theme="dark"] .email-security-banner.external {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
}
[data-theme="dark"] .email-security-banner.external .security-banner-title {
  color: #38bdf8;
}
[data-theme="dark"] .email-security-banner.external .security-banner-desc {
  color: #bae6fd;
}

[data-theme="cyberpunk"] .email-security-banner.external {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.35);
  color: #67e8f9;
}
[data-theme="cyberpunk"] .email-security-banner.external .security-banner-title {
  color: #22d3ee;
}
[data-theme="cyberpunk"] .email-security-banner.external .security-banner-desc {
  color: #a5f3fc;
}

/* 2. Phishing / Impersonation warning (Amber / Red alert) */
.email-security-banner.warning {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}
.email-security-banner.warning .security-banner-title {
  color: #c2410c;
}
.email-security-banner.warning .security-banner-desc,
.email-security-banner.warning .security-banner-list {
  color: #7c2d12;
}

[data-theme="dark"] .email-security-banner.warning {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.32);
  color: #fca5a5;
}
[data-theme="dark"] .email-security-banner.warning .security-banner-title {
  color: #f87171;
}
[data-theme="dark"] .email-security-banner.warning .security-banner-desc,
[data-theme="dark"] .email-security-banner.warning .security-banner-list {
  color: #fecaca;
}

[data-theme="cyberpunk"] .email-security-banner.warning {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.42);
  color: #fda4af;
}
[data-theme="cyberpunk"] .email-security-banner.warning .security-banner-title {
  color: #fb7185;
}
[data-theme="cyberpunk"] .email-security-banner.warning .security-banner-desc,
[data-theme="cyberpunk"] .email-security-banner.warning .security-banner-list {
  color: #ffe4e6;
}

/* ==========================================================================
   STAR & PIN TO TOP UI
   ========================================================================== */
.email-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.email-action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
  line-height: 1;
}

.email-action-icon-btn:hover {
  transform: scale(1.15);
}

.email-star-btn:hover {
  color: #f59e0b;
}

.email-star-btn.is-starred {
  color: #f59e0b !important;
}

.email-star-btn.is-starred svg,
.email-star-btn.is-starred i {
  fill: #f59e0b;
}

.email-pin-btn:hover {
  color: var(--accent-primary);
}

.email-pin-btn.is-pinned {
  color: var(--accent-primary) !important;
}

.email-pin-btn.is-pinned svg,
.email-pin-btn.is-pinned i {
  fill: var(--accent-primary);
}

.email-item.is-pinned {
  border-left: 3px solid var(--accent-primary) !important;
  background: rgba(59, 130, 246, 0.04);
}

[data-theme="dark"] .email-item.is-pinned {
  background: rgba(59, 130, 246, 0.08);
}

[data-theme="cyberpunk"] .email-item.is-pinned {
  border-left: 3px solid #ec4899 !important;
  background: rgba(236, 72, 153, 0.08);
}

.pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.04em;
}

[data-theme="cyberpunk"] .pinned-badge {
  color: #ec4899;
  background: rgba(236, 72, 153, 0.15);
}

/* ==========================================================================
   SCHEDULE SEND DROPDOWN & MODAL
   ========================================================================== */
.split-btn-group .dropdown-item {
  transition: background 0.15s ease;
}

.split-btn-group .dropdown-item:hover {
  background: var(--bg-card-hover) !important;
}

/* ==========================================================================
   OUT OF OFFICE AUTO-RESPONDER SETTINGS
   ========================================================================== */
.ooo-container {
  padding: 4px 0;
}

.ooo-toggle-group {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* ==========================================================================
   SEARCH HEADER & CONTROLS
   ========================================================================== */
.search-active-banner {
  padding: 8px 14px;
  background: var(--bg-card-hover);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
}

.search-active-banner strong {
  color: var(--text-main);
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-search:hover {
  text-decoration: underline;
}