/* ==========================================================================
   BEECURSOR MAIL - KURUMSAL İÇ POSTA SİSTEMİ DESIGN SYSTEM & STYLES
   ========================================================================== */

:root {
  --bg-main: #070A11;
  --bg-sidebar: #0C101A;
  --bg-card: #121826;
  --bg-card-hover: #192236;
  --bg-active: #1E283F;
  --border-subtle: #1C2436;
  --border-light: #28354E;
  
  --amber-primary: #F59E0B;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --amber-dark: #D97706;
  --amber-light: #FDE68A;
  
  --cyan-accent: #06B6D4;
  --cyan-glow: rgba(6, 182, 212, 0.2);
  --emerald-success: #10B981;
  --rose-danger: #F43F5E;
  --purple-accent: #8B5CF6;
  
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --header-height: 64px;
  --sidebar-width: 270px;
  --list-width: 400px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #232D42;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* ==========================================================================
   LOGIN VIEW STYLES
   ========================================================================== */
.login-view-container {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, #162035 0%, #070A12 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow-y: auto;
  padding: 24px;
}

.login-backdrop-glow {
  position: absolute;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.09) 0%, rgba(6, 182, 212, 0.04) 40%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-portal-wrapper {
  position: relative;
  width: 960px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: rgba(13, 19, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.85), 0 0 50px rgba(245, 158, 11, 0.06);
  backdrop-filter: blur(24px);
  overflow: hidden;
  animation: loginPortalAppear 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginPortalAppear {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Left: Enterprise Brand & Credentials Panel */
.login-brand-panel {
  background: linear-gradient(155deg, rgba(22, 31, 54, 0.6) 0%, rgba(10, 15, 26, 0.85) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.brand-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34D399;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  align-self: flex-start;
  font-family: var(--font-mono);
}

.live-status-dot {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10B981;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.brand-crest-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.corp-logo-crest {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 18px var(--amber-glow));
}

.corp-mail-svg {
  width: 100%;
  height: 100%;
}

.brand-title-wrap h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.badge-gold {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #070A11;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.6px;
}

.brand-title-wrap p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

.brand-mission-desc {
  color: #94A3B8;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

.security-features-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.security-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--amber-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.security-feature-item:nth-child(2) .feat-icon {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.2);
  color: var(--cyan-accent);
}

.security-feature-item:nth-child(3) .feat-icon {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--emerald-success);
}

.security-feature-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.security-feature-item strong {
  font-size: 0.84rem;
  font-weight: 700;
  color: #E2E8F0;
}

.security-feature-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.brand-panel-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: #64748B;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 18px;
}

/* Right: Authentication Card Panel */
.login-card-panel {
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-header {
  margin-bottom: 24px;
}

.login-card-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

.login-card-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.login-error-alert {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #FDA4AF;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-input-group {
  margin-bottom: 18px;
}

.login-input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94A3B8;
  margin-bottom: 6px;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #090E1A;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.login-input-wrapper:focus-within {
  border-color: var(--amber-primary);
  box-shadow: 0 0 0 3px var(--amber-glow);
  background: #0B1222;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: #64748B;
  font-size: 0.95rem;
}

.login-input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 12px 42px 12px 42px;
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
}

.login-input-wrapper input::placeholder {
  color: #475569;
}

.btn-pwd-eye {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #64748B;
  cursor: pointer;
  padding: 6px;
}
.btn-pwd-eye:hover { color: var(--text-main); }

.btn-login-submit {
  width: 100%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #070A11;
  border: none;
  padding: 13px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 10px;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(245, 158, 11, 0.55);
}

.login-security-notice {
  margin-top: 20px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  gap: 10px;
  font-size: 0.74rem;
  color: #94A3B8;
  line-height: 1.45;
}

.login-security-notice i {
  color: var(--amber-primary);
  font-size: 1rem;
  margin-top: 2px;
}

/* Stage 2 OTP Specifics */
.otp-badge-top {
  width: 48px;
  height: 48px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.otp-dest-highlight {
  color: var(--amber-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.otp-actions-footer {
  margin-top: 18px;
  text-align: center;
}

.btn-link-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.btn-link-action:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

/* Responsive Portal Layout */
@media (max-width: 860px) {
  .login-portal-wrapper {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .login-brand-panel {
    display: none;
  }
  .login-card-panel {
    padding: 34px 26px;
  }
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: var(--sidebar-width);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.logo-icon-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px var(--amber-glow));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo:hover .logo-icon-wrap {
  transform: scale(1.1) rotate(5deg);
}

.bee-svg {
  width: 36px;
  height: 36px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--amber-primary), #D97706);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-success);
  box-shadow: 0 0 8px var(--emerald-success);
  display: inline-block;
  animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Search Box */
.header-center {
  flex: 1;
  max-width: 540px;
  margin: 0 20px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #111724;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 40px;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--amber-primary);
  box-shadow: 0 0 0 3px var(--amber-glow);
  background: #141B2B;
}

.search-icon {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-right: 10px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-kbd {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: #1E283F;
  border: 1px solid #334155;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  margin-left: 6px;
}
.clear-search-btn:hover { color: var(--text-main); }

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #131A29;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.header-btn:hover {
  background: #1C253B;
  color: var(--text-main);
  border-color: var(--border-light);
}

.header-btn i {
  color: var(--amber-primary);
}

.admin-highlight-btn {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber-primary);
}
.admin-highlight-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--amber-primary);
  color: #FFFFFF;
}

/* User Switcher */
.user-switcher-container {
  position: relative;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #131A29;
  border: 1px solid var(--border-subtle);
  padding: 5px 12px 5px 6px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-btn:hover {
  background: #1C263D;
  border-color: var(--amber-primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #0B0F17;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.user-details-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.1;
}

.user-role-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.switch-caret {
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #111726;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  z-index: 1000;
  display: none;
  animation: fadeInDown 0.2s ease;
}

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

.dropdown-header {
  padding: 12px 16px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-header span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.dropdown-header small {
  font-size: 0.68rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.dropdown-meta-email {
  padding: 0 16px 12px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--border-subtle);
}

.dropdown-actions {
  padding: 6px;
}

.dropdown-act-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.dropdown-act-btn:hover {
  background: #1C253B;
  color: var(--text-main);
}

.dropdown-act-btn.danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-danger);
}

/* ==========================================================================
   APP LAYOUT (3 COLUMNS)
   ========================================================================== */
.app-layout {
  flex: 1;
  display: flex;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* 1. LEFT SIDEBAR */
.sidebar-left {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 12px;
  overflow-y: auto;
}

.btn-compose {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #070A11;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 8px;
  font-family: inherit;
}

.btn-compose:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 4px 10px;
}

.nav-folders {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.folder-item:hover {
  background: #141B2A;
  color: var(--text-main);
}

.folder-item.active {
  background: #1A243A;
  color: #FFFFFF;
  font-weight: 600;
  border-left: 3px solid var(--amber-primary);
}

.folder-item.active i {
  color: var(--amber-primary);
}

.folder-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-left i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

.count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--amber-primary);
  color: #000;
  padding: 1px 7px;
  border-radius: 10px;
}

.count-badge.secondary {
  background: #1E283F;
  color: var(--text-muted);
}

.count-badge.empty {
  display: none;
}

/* Distribution Groups List */
.distribution-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.group-item:hover {
  background: #141B2A;
  color: var(--text-main);
}

.group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.group-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
}

.storage-info-box {
  background: #111724;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
}

.storage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.status-free {
  font-size: 0.65rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-success);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.storage-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.storage-line {
  height: 4px;
  background: #1E283F;
  border-radius: 2px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  background: var(--amber-primary);
  border-radius: 2px;
}

/* 2. MIDDLE COLUMN: EMAIL LIST */
.email-list-column {
  width: var(--list-width);
  min-width: 340px;
  background: var(--bg-main);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-controls-bar {
  padding: 14px 16px;
  background: #0A0E18;
  border-bottom: 1px solid var(--border-subtle);
}

.list-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.current-folder-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.icon-tool-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-tool-btn:hover {
  background: #141B2A;
  color: var(--text-main);
  border-color: var(--border-light);
}

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.chip-btn {
  background: #121826;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: inherit;
}

.chip-btn:hover {
  background: #1A243A;
  color: var(--text-main);
}

.chip-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--amber-primary);
  color: var(--amber-primary);
}

/* Email List Items Container */
.email-items-container {
  flex: 1;
  overflow-y: auto;
}

.email-item-card {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease, border-left 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.email-item-card:hover {
  background: #0E1422;
}

.email-item-card.active {
  background: #131B2C;
  border-left: 3px solid var(--amber-primary);
}

.email-item-card.unread {
  background: rgba(245, 158, 11, 0.03);
}

.email-item-card.unread .item-subject {
  font-weight: 700;
  color: #FFFFFF;
}

.email-item-card.unread .item-sender-name {
  font-weight: 700;
  color: #FFFFFF;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sender-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #000;
}

.item-sender-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
}

.item-date {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.item-subject-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-priority-flag {
  font-size: 0.65rem;
  color: var(--rose-danger);
}

.item-subject {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.item-snippet {
  font-size: 0.76rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.item-bottom-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.item-ref-tag {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--amber-primary);
  background: rgba(245, 158, 11, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
}

.item-icons-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-att-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-star-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
}
.item-star-btn.starred {
  color: var(--amber-primary);
}

.empty-list-notice {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* 3. RIGHT COLUMN: EMAIL DETAIL VIEW */
.email-detail-column {
  flex: 1;
  background: #090D16;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.detail-empty-state {
  margin: auto;
  text-align: center;
  max-width: 420px;
  padding: 30px;
}

.empty-icon-box {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #111724;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-svg {
  width: 50px;
  height: 50px;
}

.detail-empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.detail-empty-state p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 24px;
}

.shortcuts-hint {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hint-item {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

kbd {
  background: #1C263A;
  border: 1px solid #334155;
  color: var(--amber-primary);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* Loaded Email View */
.detail-content-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.detail-top-toolbar {
  height: 52px;
  padding: 0 24px;
  background: #0D121F;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  background: #141C2C;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tool-btn:hover {
  background: #1C263C;
  border-color: var(--border-light);
}

.tool-icon-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-icon-btn:hover {
  background: #141C2C;
  color: var(--text-main);
  border-color: var(--border-light);
}

.tool-icon-btn.danger:hover {
  color: var(--rose-danger);
  border-color: var(--rose-danger);
}

/* Mail Paper / Document Container */
.mail-paper {
  padding: 30px 40px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.mail-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border-light);
  margin-bottom: 20px;
}

.doc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: #121826;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.doc-ref {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--amber-primary);
}

.doc-priority {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-success);
}

.doc-priority.urgent {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.mail-subject {
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.3;
  margin-bottom: 20px;
}

.mail-meta-card {
  display: flex;
  gap: 14px;
  background: #0E1422;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.sender-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #000;
  flex-shrink: 0;
}

.sender-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sender-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sender-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.sender-dept-badge {
  font-size: 0.68rem;
  font-weight: 600;
  background: #1C263A;
  color: var(--cyan-accent);
  padding: 2px 8px;
  border-radius: 4px;
}

.mail-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

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

.recipients-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.recipients-line strong {
  color: var(--text-dim);
}

/* Attachments Box */
.mail-attachments-section {
  background: #0F1626;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}

.attachments-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.attachment-download-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #141D30;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.attachment-download-card:hover {
  background: #1A253D;
  border-color: var(--amber-primary);
}

.attachment-download-card i {
  color: var(--amber-primary);
  font-size: 1.1rem;
}

.att-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.att-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Mail Body Formatting */
.mail-body-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #E2E8F0;
  margin-bottom: 30px;
}

.mail-body-content p {
  margin-bottom: 14px;
}

.mail-body-content h1, 
.mail-body-content h2, 
.mail-body-content h3, 
.mail-body-content h4 {
  color: #FFFFFF;
  margin: 18px 0 10px;
}

.mail-body-content ul, 
.mail-body-content ol {
  margin: 12px 0 16px 24px;
}

.mail-body-content li {
  margin-bottom: 6px;
}

.mail-body-content blockquote {
  border-left: 3px solid var(--amber-primary);
  background: rgba(245, 158, 11, 0.05);
  padding: 10px 16px;
  border-radius: 0 6px 6px 0;
  color: #CBD5E1;
  margin: 16px 0;
}

.mail-body-content code {
  font-family: var(--font-mono);
  background: #1A2338;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--amber-primary);
}

/* Quick Reply Box */
.quick-reply-box {
  background: #0C111C;
  border-top: 1px solid var(--border-subtle);
  padding: 16px 40px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.quick-reply-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.quick-reply-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-reply-input-wrap textarea {
  width: 100%;
  height: 70px;
  background: #121826;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

.quick-reply-input-wrap textarea:focus {
  border-color: var(--amber-primary);
  box-shadow: 0 0 0 2px var(--amber-glow);
}

.quick-reply-bottom {
  display: flex;
  justify-content: flex-end;
}

.btn-send-reply {
  background: var(--amber-primary);
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-send-reply:hover {
  background: var(--amber-dark);
}

/* ==========================================================================
   ADMIN PANEL WINDOW & STYLES
   ========================================================================== */
.admin-panel-window {
  width: 960px;
  max-width: 95vw;
  height: 740px;
  max-height: 90vh;
  background: #0B101E;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-panel-header {
  padding: 16px 24px;
  background: #0E1528;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-tabs-nav {
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  background: #0D1324;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.admin-tab-btn:hover {
  color: var(--text-main);
  background: #141C30;
}

.admin-tab-btn.active {
  background: #19243C;
  color: var(--amber-primary);
  border-color: rgba(245, 158, 11, 0.3);
  font-weight: 700;
}

.admin-tab-content {
  flex: 1;
  display: none;
  flex-direction: column;
  padding: 20px 24px;
  overflow-y: auto;
}

.admin-tab-content.active {
  display: flex;
}

/* Admin Action Bar */
.admin-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.admin-search-wrap {
  flex: 1;
  max-width: 380px;
  position: relative;
  display: flex;
  align-items: center;
  background: #11182A;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0 12px;
}

.admin-search-wrap i {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-right: 8px;
}

.admin-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 8px 0;
  font-size: 0.85rem;
  font-family: inherit;
}

.btn-admin-add-user {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #070A11;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-admin-add-user:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

/* Admin Table */
.admin-table-wrap {
  flex: 1;
  background: #0E1424;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-y: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.admin-table th {
  background: #121A2C;
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #141D32;
}

.table-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-user-name {
  font-weight: 700;
  color: var(--text-main);
}

.table-user-title {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.role-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}
.role-pill.admin {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.role-pill.employee {
  background: #1A2338;
  color: var(--text-muted);
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.status-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-success);
}
.status-pill.suspended {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-danger);
}

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

.btn-row-action {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #12192A;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.btn-row-action:hover {
  background: #1C263E;
  color: var(--text-main);
  border-color: var(--border-light);
}

.btn-row-action.danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-danger);
  border-color: var(--rose-danger);
}

/* Domain Guide Box */
.domain-guide-box {
  background: #0E1424;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

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

.guide-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-target-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-accent);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.guide-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.method-card {
  background: #121A2C;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.method-card.featured {
  border-color: var(--amber-primary);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.method-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--amber-primary);
  margin-bottom: 8px;
}

.method-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.method-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 12px;
}

.method-card ol {
  margin-left: 18px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.method-card code {
  font-family: var(--font-mono);
  background: #1B2438;
  color: var(--amber-primary);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.metric-tile {
  background: #0E1424;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.metric-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #FFFFFF;
  font-family: var(--font-mono);
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--amber-primary);
}

/* ==========================================================================
   COMPOSE MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose-window {
  width: 760px;
  max-width: 95vw;
  height: 640px;
  max-height: 92vh;
  background: #0E1424;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.compose-header {
  padding: 12px 18px;
  background: #121A2C;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compose-header-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}
.compose-header-title i {
  color: var(--amber-primary);
}

.compose-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-ctrl-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.modal-ctrl-btn:hover {
  background: #1A243A;
  color: var(--text-main);
  border-color: var(--border-light);
}

/* Template Picker Bar */
.template-picker-bar {
  background: #141C2E;
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
}

.tpl-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-primary);
  white-space: nowrap;
}

.tpl-buttons {
  display: flex;
  gap: 6px;
}

.tpl-btn {
  background: #1A243A;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tpl-btn:hover {
  background: var(--amber-primary);
  color: #000;
  border-color: var(--amber-primary);
}

/* Compose Fields */
.compose-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  overflow-y: auto;
  gap: 8px;
  position: relative;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.field-label {
  width: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
}

.field-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-input-wrap input,
.field-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.86rem;
  font-family: inherit;
}

.field-shortcuts {
  display: flex;
  gap: 8px;
}

.toggle-field-btn {
  font-size: 0.72rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.toggle-field-btn:hover { color: var(--amber-primary); }

/* Autocomplete List */
.autocomplete-list {
  position: absolute;
  top: 48px;
  left: 70px;
  right: 18px;
  background: #121828;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  z-index: 100;
  max-height: 180px;
  overflow-y: auto;
}

.ac-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.1s ease;
}
.ac-item:hover {
  background: #1E283F;
}

.subject-priority-row {
  display: flex;
  justify-content: space-between;
}

.subject-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.priority-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.priority-select {
  background: #141C2E;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  outline: none;
}

/* Rich Editor Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.ed-btn:hover {
  background: #1A2438;
  color: #FFFFFF;
}

.ed-sep {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 4px;
}

/* Compose Body */
.compose-body-editor {
  flex: 1;
  min-height: 200px;
  outline: none;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-y: auto;
  padding: 8px 0;
}

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

/* Selected Attachments Bar */
.selected-attachments-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.file-tag {
  background: #162032;
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.file-tag i { color: var(--amber-primary); }
.file-tag .remove-file {
  cursor: pointer;
  color: var(--rose-danger);
}

/* Compose Footer */
.compose-footer {
  padding: 12px 18px;
  background: #121A2C;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-send-main {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #070A11;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-send-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

.btn-attach {
  background: #182236;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-attach:hover {
  background: #202D47;
}

.btn-footer-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
}
.btn-footer-link:hover { color: var(--text-main); }
.btn-footer-link.danger:hover { color: var(--rose-danger); }

/* ==========================================================================
   STANDARD MODAL (NETWORK, DIRECTORY, ADD USER)
   ========================================================================== */
.standard-modal-box {
  width: 560px;
  max-width: 90vw;
  background: #0E1424;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
  overflow: hidden;
  animation: modalScale 0.2s ease;
}

.standard-modal-box.directory-box {
  width: 720px;
}

.modal-header {
  padding: 16px 20px;
  background: #121A2C;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title i { color: var(--amber-primary); }

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-close:hover { color: #FFFFFF; }

.modal-body {
  padding: 20px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.network-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.net-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #131B2C;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.net-info-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.net-ip-url {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cyan-accent);
}

.btn-copy-link {
  background: #1A243A;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
}
.btn-copy-link:hover { background: var(--amber-primary); color: #000; }

.qr-section {
  background: #121929;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.qr-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.qr-code-wrap {
  background: #FFFFFF;
  padding: 8px;
  border-radius: 8px;
  width: 116px;
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-text strong {
  font-size: 0.95rem;
  color: #FFFFFF;
}

.qr-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tip-box {
  display: flex;
  gap: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.8rem;
  color: #D1FAE5;
  line-height: 1.4;
}
.tip-box i {
  color: var(--emerald-success);
  font-size: 1.1rem;
  margin-top: 2px;
}

/* Directory Grid */
.directory-search-bar {
  position: relative;
  margin-bottom: 16px;
}

.directory-search-bar input {
  width: 100%;
  background: #121826;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 38px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.directory-search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.employees-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.dir-user-card {
  background: #12192A;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.dir-user-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.dir-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: #000;
}

.dir-user-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dir-user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.dir-user-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-user-email {
  font-size: 0.72rem;
  color: var(--amber-primary);
  font-family: var(--font-mono);
}

.btn-dir-mail {
  background: #1A243A;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-dir-mail:hover {
  background: var(--amber-primary);
  color: #000;
}

/* Add User Form */
.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, 
.form-group select {
  background: #121826;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.form-group input:focus, 
.form-group select:focus {
  border-color: var(--amber-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-addon-wrap {
  display: flex;
  background: #121826;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.input-addon-wrap input {
  flex: 1;
  border: none;
  background: transparent;
}

.input-addon-wrap .addon {
  background: #1A2438;
  color: var(--amber-primary);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 0 10px;
  display: flex;
  align-items: center;
}

.form-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.btn-submit-user {
  background: var(--amber-primary);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #111827;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--amber-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  padding: 12px 16px;
  width: 320px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

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

.toast-icon {
  color: var(--amber-primary);
  font-size: 1.1rem;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
}

.toast-msg {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    height: auto !important;
    overflow: visible !important;
  }

  .login-view-container, .app-header, .sidebar-left, .email-list-column, .detail-top-toolbar, .quick-reply-box, .modal-overlay, #toast-container {
    display: none !important;
  }

  .app-layout {
    display: block !important;
    height: auto !important;
  }

  .email-detail-column {
    background: #FFFFFF !important;
    overflow: visible !important;
  }

  .mail-paper {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .mail-meta-card {
    background: #F8FAFC !important;
    border: 1px solid #CBD5E1 !important;
    color: #0F172A !important;
  }

  .sender-name, .mail-subject {
    color: #0F172A !important;
  }

  .mail-body-content {
    color: #1E293B !important;
  }
}
