    :root {
      --bg-base: #0b0f19;
      --bg-gradient: radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.12), transparent 45%),
                         radial-gradient(circle at 85% 85%, rgba(56, 189, 248, 0.08), transparent 40%),
                         #0b0f19;
      --surface: #111827;
      --surface-card: #141e33;
      --surface-dim: #0d1526;
      --surface-hover: #1e293b;
      --border: rgba(255, 255, 255, 0.09);
      --border-focus: #38bdf8;
      --text: #f1f5f9;
      --text-muted: #94a3b8;
      --text-dim: #64748b;
      --accent: #38bdf8;
      --accent-hover: #0ea5e9;
      --accent-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
      --accent-glow: rgba(56, 189, 248, 0.25);
      --success: #10b981;
      --danger: #ef4444;
      --warning: #f59e0b;
      --radius: 12px;
      --radius-sm: 8px;
      --radius-lg: 16px;
      --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
      --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.4);
      --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      --mono: 'JetBrains Mono', monospace;
    }

    [data-theme="light"] {
      --bg-base: #f8fafc;
      --bg-gradient: radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.06), transparent 40%),
                         radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.05), transparent 40%),
                         #f8fafc;
      --surface: #ffffff;
      --surface-card: #ffffff;
      --surface-dim: #f1f5f9;
      --surface-hover: #f8fafc;
      --border: #e2e8f0;
      --border-focus: #0284c7;
      --text: #0f172a;
      --text-muted: #475569;
      --text-dim: #64748b;
      --accent: #0284c7;
      --accent-hover: #0369a1;
      --accent-glow: rgba(2, 132, 199, 0.18);
      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
      --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.1);
    }

    [data-theme="dark"],
    [data-theme="default"],
    :root {
      --bg-base: #090d16;
      --bg-gradient: radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.1), transparent 45%),
                         radial-gradient(circle at 85% 85%, rgba(56, 189, 248, 0.06), transparent 40%),
                         #090d16;
      --surface: #0f172a;
      --surface-card: #131d33;
      --surface-dim: #0a0f1d;
      --surface-hover: #1e293b;
      --border: rgba(255, 255, 255, 0.08);
      --border-focus: #38bdf8;
      --text: #f1f5f9;
      --text-muted: #94a3b8;
      --text-dim: #64748b;
      --accent: #38bdf8;
      --accent-hover: #0ea5e9;
    }

    [data-theme="ocean"] {
      --bg-base: #04101e;
      --bg-gradient: radial-gradient(circle at 20% 20%, rgba(2, 132, 199, 0.18), transparent 50%),
                         radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.12), transparent 45%),
                         #04101e;
      --surface: #0b1f38;
      --surface-card: #0f2746;
      --surface-dim: #06162a;
      --surface-hover: #14355d;
      --border: rgba(56, 189, 248, 0.15);
      --border-focus: #38bdf8;
      --text: #e0f2fe;
      --text-muted: #7dd3fc;
      --text-dim: #38bdf8;
      --accent: #38bdf8;
      --accent-hover: #0ea5e9;
      --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    }

    [data-theme="nord"] {
      --bg-base: #242933;
      --bg-gradient: radial-gradient(circle at 15% 15%, rgba(136, 192, 208, 0.12), transparent 45%),
                         radial-gradient(circle at 85% 85%, rgba(129, 161, 193, 0.08), transparent 40%),
                         #242933;
      --surface: #2e3440;
      --surface-card: #3b4252;
      --surface-dim: #222630;
      --surface-hover: #434c5e;
      --border: rgba(216, 222, 233, 0.12);
      --border-focus: #88c0d0;
      --text: #eceff4;
      --text-muted: #d8dee9;
      --text-dim: #88c0d0;
      --accent: #88c0d0;
      --accent-hover: #81a1c1;
      --accent-gradient: linear-gradient(135deg, #5e81ac 0%, #88c0d0 100%);
    }

    [data-theme="corporate"] {
      --bg-base: #0f1e36;
      --bg-gradient: radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.15), transparent 45%),
                         radial-gradient(circle at 85% 85%, rgba(30, 64, 175, 0.1), transparent 40%),
                         #0f1e36;
      --surface: #162847;
      --surface-card: #1b3258;
      --surface-dim: #0d192e;
      --surface-hover: #223f6e;
      --border: rgba(255, 255, 255, 0.1);
      --border-focus: #3b82f6;
      --text: #f8fafc;
      --text-muted: #93c5fd;
      --text-dim: #60a5fa;
      --accent: #3b82f6;
      --accent-hover: #2563eb;
      --accent-gradient: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    }

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

    a, a:hover, a:focus, a:active {
      text-decoration: none !important;
      color: inherit;
    }

    body {
      font-family: var(--font) !important;
      background: var(--bg-gradient) !important;
      color: var(--text) !important;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
    }

    /* PREVENT BOOTSTRAP FROM DISTORTING CUSTOM WEBMAIL TABLES */
    table.messages-table {
      background: transparent !important;
      color: var(--text) !important;
      border-collapse: collapse !important;
      width: 100%;
    }
    table.messages-table thead th {
      background: var(--surface-dim) !important;
      color: var(--text-dim) !important;
      border-bottom: 1px solid var(--border) !important;
    }
    table.messages-table tbody tr {
      background: transparent !important;
      color: var(--text) !important;
      border-bottom: 1px solid var(--border) !important;
    }
    table.messages-table tbody tr:hover {
      background: var(--surface-hover) !important;
    }
    table.messages-table tbody tr.unread {
      background: rgba(56, 189, 248, 0.04) !important;
    }
    table.messages-table td {
      background: transparent !important;
      color: inherit !important;
      border: none !important;
    }

    /* GLOBAL ROCK-SOLID ICONS STYLING */
    svg.lucide, .lucide, i[data-lucide] {
      width: 1.15em;
      height: 1.15em;
      min-width: 1.15em;
      min-height: 1.15em;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      vertical-align: -0.15em;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      fill: none;
      flex-shrink: 0;
      box-sizing: content-box;
    }

    /* ======================================================== */
    /* TELA DE LOGIN CORPORATIVA (STANDALONE FULL VIEWPORT)     */
    /* ======================================================== */
    .login-viewport-container {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      position: relative;
    }

    .login-system-card {
      width: 100%;
      max-width: 440px;
      background: var(--surface-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 2.25rem 2rem;
      box-shadow: var(--shadow-lg);
      position: relative;
      animation: fadeInScale 0.25s ease-out;
    }

    @keyframes fadeInScale {
      from { opacity: 0; transform: scale(0.97); }
      to { opacity: 1; transform: scale(1); }
    }

    .login-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1.75rem;
    }

    .login-brand-group {
      display: flex;
      align-items: center;
      gap: 0.85rem;
    }

    .login-logo-box {
      width: 46px;
      height: 46px;
      border-radius: 12px;
      background: var(--accent-gradient);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #ffffff;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    }
    .login-logo-box svg { width: 24px; height: 24px; }

    .login-title-h1 {
      font-size: 1.4rem;
      font-weight: 800;
      color: var(--text);
      line-height: 1.1;
      letter-spacing: -0.02em;
    }

    .login-title-sub {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-top: 0.2rem;
    }

    .login-header-tools {
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    .btn-terminal-discreet {
      width: 34px;
      height: 34px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-dim);
      color: var(--text-dim);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-terminal-discreet:hover {
      background: var(--surface-hover);
      color: var(--accent);
      border-color: var(--accent);
    }
    .btn-terminal-discreet svg { width: 16px; height: 16px; }

    .theme-toggle-group {
      display: inline-flex;
      align-items: center;
      background: var(--surface-dim);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 2px;
      gap: 2px;
      height: 34px;
      box-sizing: border-box;
    }
    .btn-theme-item {
      width: 28px;
      height: 28px;
      border: none;
      background: transparent;
      color: var(--text-dim);
      border-radius: 4px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
      padding: 0;
      margin: 0;
    }
    .btn-theme-item:hover {
      color: var(--text);
      background: var(--surface-hover);
    }
    .btn-theme-item.active {
      background: var(--surface-card);
      color: var(--accent);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    }
    .btn-theme-item svg,
    .btn-theme-item i {
      width: 14px !important;
      height: 14px !important;
      display: block;
    }

    .terminal-header-actions {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }
    .btn-copy-diag-json {
      height: 26px;
      padding: 0 0.65rem;
      border-radius: var(--radius-sm);
      border: 1px solid rgba(56, 189, 248, 0.35);
      background: rgba(56, 189, 248, 0.12);
      color: #38bdf8;
      font-size: 0.72rem;
      font-weight: 600;
      font-family: var(--sans);
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-copy-diag-json:hover {
      background: rgba(56, 189, 248, 0.22);
      border-color: #38bdf8;
      color: #ffffff;
    }
    .btn-copy-diag-json svg {
      width: 13px !important;
      height: 13px !important;
    }

    .login-alert-danger {
      background: rgba(239, 68, 68, 0.12);
      border: 1px solid rgba(239, 68, 68, 0.3);
      color: #ef4444;
      padding: 0.75rem 1rem;
      border-radius: var(--radius-sm);
      font-size: 0.82rem;
      margin-bottom: 1.25rem;
      display: flex;
      align-items: flex-start;
      gap: 0.6rem;
    }
    .login-alert-danger svg { width: 17px; height: 17px; margin-top: 2px; }

    .webmail-login-form {
      display: flex;
      flex-direction: column;
      gap: 1.2rem;
    }

    .field-block label {
      display: block;
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 0.45rem;
    }

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

    .input-icon-wrapper .field-lead-icon {
      position: absolute;
      left: 12px;
      width: 17px;
      height: 17px;
      color: var(--text-dim);
      pointer-events: none;
    }

    .input-icon-wrapper input {
      width: 100%;
      height: 44px;
      padding: 0 2.5rem 0 2.45rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-dim);
      color: var(--text);
      font-size: 0.92rem;
      font-family: inherit;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
    }

    .input-icon-wrapper input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }

    .btn-password-toggle {
      position: absolute;
      right: 10px;
      background: none;
      border: none;
      color: var(--text-dim);
      cursor: pointer;
      padding: 6px;
      display: flex;
      align-items: center;
      border-radius: 4px;
    }
    .btn-password-toggle:hover { color: var(--text); }
    .btn-password-toggle svg { width: 16px; height: 16px; }

    .btn-webmail-submit {
      height: 46px;
      border-radius: var(--radius-sm);
      background: var(--accent-gradient);
      color: #ffffff;
      border: none;
      font-size: 0.95rem;
      font-weight: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
      transition: all 0.2s ease;
      margin-top: 0.5rem;
    }
    .btn-webmail-submit:hover {
      filter: brightness(1.08);
      transform: translateY(-1px);
      box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    }
    .btn-webmail-submit svg { width: 18px; height: 18px; }

    /* Modal / Drawer de Diagnóstico IMAP Discreto */
    .imap-terminal-drawer {
      display: none;
      margin-top: 1.25rem;
      background: #090d16;
      border: 1px solid rgba(56, 189, 248, 0.25);
      border-radius: var(--radius-sm);
      overflow: hidden;
    }
    .terminal-drawer-header {
      background: #0f172a;
      padding: 0.5rem 0.85rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .terminal-drawer-title {
      font-family: var(--mono);
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--accent);
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }
    .terminal-drawer-title svg { width: 14px; height: 14px; }
    .terminal-drawer-close {
      background: none;
      border: none;
      color: var(--text-dim);
      cursor: pointer;
      padding: 2px;
    }
    .terminal-drawer-close:hover { color: var(--text); }
    .terminal-drawer-close svg { width: 14px; height: 14px; }
    .terminal-drawer-body {
      padding: 0.85rem;
      font-family: var(--mono);
      font-size: 0.75rem;
      line-height: 1.5;
      color: #94a3b8;
      max-height: 320px;
      overflow-y: auto;
      white-space: pre-wrap;
      word-break: break-all;
    }

    /* ======================================================== */
    /* 1. TOP BAR BOXED (DENTRO DO CONTAINER PRINCIPAL)         */
    /* ======================================================== */
    .cloudmail-app-shell {
      width: 100%;
      max-width: 1680px;
      margin: 1.25rem auto;
      padding: 0 1.25rem 2rem 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
      box-sizing: border-box;
      flex: 1;
    }

        /* ======================================================== */
    /* REVISED LAYOUT: FULL SIDEBAR & INLINE FOLDER SEARCH */
    /* ======================================================== */
    .cloudmail-app-shell {
      width: 100%;
      max-width: 1680px;
      margin: 1rem auto;
      padding: 0 1.25rem 1.5rem 1.25rem;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      flex: 1;
    }

    /* Live IMAP latency display in sidebar */
    .topbar-latency {
      font-family: var(--mono);
      font-size: 0.72rem;
      color: var(--accent);
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }
    .topbar-latency svg { width: 12px; height: 12px; }

    /* Estilos do Brand / Logo no Sidebar */
    .sidebar-brand-header {
      padding: 0.25rem 0.25rem 0.75rem 0.25rem;
      border-bottom: 1px solid var(--border);
      margin-bottom: 0.65rem;
    }
    .sidebar-brand-header .cloudmail-brand-logo {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      text-decoration: none;
      color: var(--text);
    }
    .sidebar-brand-header .brand-icon-box {
      width: 32px;
      height: 32px;
      border-radius: var(--radius-sm);
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(37, 99, 235, 0.2));
      border: 1px solid rgba(56, 189, 248, 0.35);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent);
      flex-shrink: 0;
    }
    .sidebar-brand-header .brand-icon-box svg { width: 16px; height: 16px; }
    .sidebar-brand-header .brand-text-col {
      display: flex;
      flex-direction: column;
      line-height: 1.15;
    }
    .sidebar-brand-header .brand-name {
      font-weight: 800;
      font-size: 1.05rem;
      letter-spacing: -0.02em;
    }
    .sidebar-brand-header .brand-ver {
      font-size: 0.68rem;
      color: var(--accent);
      font-weight: 600;
    }

    /* Informações de Conta abaixo do Logo */
    .sidebar-account-info {
      background: var(--surface-dim);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.5rem 0.65rem;
      margin-bottom: 0.85rem;
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
    }
    .sidebar-user-row {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      min-width: 0;
    }
    .sidebar-email-text {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
    }

    /* Actions Strip (5 icons) below Storage Widget */
    .sidebar-actions-strip {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.35rem;
      padding-top: 0.65rem;
      margin-top: 0.5rem;
      border-top: 1px solid var(--border);
      position: relative;
    }
    .btn-sidebar-icon {
      flex: 1;
      height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--surface-dim);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-dim);
      cursor: pointer;
      transition: all 0.15s ease;
      text-decoration: none;
      padding: 0;
    }
    .btn-sidebar-icon:hover {
      background: var(--surface-hover);
      color: var(--accent);
      border-color: var(--border-focus);
    }
    .btn-sidebar-icon svg { width: 15px; height: 15px; }
    .btn-sidebar-icon-danger:hover {
      color: var(--danger) !important;
      border-color: rgba(239, 68, 68, 0.4) !important;
      background: rgba(239, 68, 68, 0.1) !important;
    }

    /* Dropdown de Idiomas */
    .sidebar-lang-container {
      flex: 1;
      position: relative;
      display: flex;
    }
    .sidebar-lang-dropdown {
      display: none;
      position: absolute;
      bottom: calc(100% + 8px);
      left: 50%;
      transform: translateX(-50%);
      background: var(--surface-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      box-shadow: var(--shadow-md);
      padding: 4px;
      z-index: 100;
      min-width: 96px;
      flex-direction: column;
      gap: 2px;
    }
    .sidebar-lang-dropdown.show {
      display: flex;
    }
    .sidebar-lang-opt {
      padding: 5px 8px;
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text);
      text-decoration: none;
      border-radius: 4px;
      display: flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      transition: background 0.15s ease;
    }
    .sidebar-lang-opt:hover, .sidebar-lang-opt.active {
      background: var(--surface-hover);
      color: var(--accent);
    }

    /* Busca de mensagens no Folder-Header-Bar */
    .folder-search-wrap {
      flex: 1;
      max-width: 420px;
      min-width: 200px;
      position: relative;
      margin: 0 0.5rem;
    }
    .folder-search-wrap svg {
      position: absolute;
      left: 11px;
      top: 50%;
      transform: translateY(-50%);
      width: 14px;
      height: 14px;
      color: var(--text-dim);
      pointer-events: none;
    }
    .folder-search-input {
      width: 100%;
      height: 34px;
      padding: 0 0.75rem 0 2.1rem;
      border-radius: var(--radius-sm);
      background: var(--surface-dim);
      border: 1px solid var(--border);
      color: var(--text);
      font-size: 0.82rem;
      outline: none;
      transition: all 0.15s ease;
      box-sizing: border-box;
    }
    .folder-search-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 2px var(--accent-glow);
    }

    /* ======================================================== */
    /* 2. SIDEBAR FLUTUANTE OCUPANDO A TELA SEM ESTOURAR        */
    /* ======================================================== */
    .cloudmail-workspace {
      display: flex;
      gap: 1.25rem;
      width: 100%;
      align-items: flex-start;
      flex: 1;
      box-sizing: border-box;
    }

    .cloudmail-sidebar {
      position: sticky;
      top: 1.25rem;
      width: 280px;
      min-width: 280px;
      flex-shrink: 0;
      height: calc(100vh - 2.25rem);
      max-height: calc(100vh - 2.25rem);
      background: var(--surface-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 1.15rem 1rem 0.85rem 1rem;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      z-index: 40;
      box-sizing: border-box;
      overflow: hidden;
    }

    .btn-compose-primary {
      width: 100%;
      height: 44px;
      border-radius: var(--radius-sm);
      background: var(--accent-gradient);
      color: #ffffff;
      border: none;
      font-size: 0.9rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
      cursor: pointer;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
      transition: all 0.15s ease;
      margin-bottom: 1.15rem;
      text-decoration: none;
      flex-shrink: 0;
    }
    .btn-compose-primary:hover {
      filter: brightness(1.08);
      transform: translateY(-1px);
    }
    .btn-compose-primary.active {
      box-shadow: 0 0 0 3px var(--accent-glow);
      filter: brightness(1.1);
    }
    .btn-compose-primary svg { width: 17px; height: 17px; }

    .sidebar-section-title {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-dim);
      padding: 0 0.5rem 0.4rem 0.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }

    /* 3. LISTA COM ROLAGEM INTERNA E RECUO DAS SUBPASTAS */
    .folders-scroll-list {
      flex: 1 1 0;
      min-height: 0;
      overflow-y: auto;
      list-style: none;
      margin: 0;
      padding: 0.25rem 0;
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }

    .folders-scroll-list::-webkit-scrollbar { width: 5px; }
    .folders-scroll-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

    .folder-item-link {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.48rem 0.65rem;
      border-radius: var(--radius-sm);
      text-decoration: none;
      color: var(--text-muted);
      font-size: 0.84rem;
      font-weight: 500;
      transition: all 0.12s ease;
    }
    .folder-item-link:hover {
      background: var(--surface-hover);
      color: var(--text);
    }
    .folder-item-link.active {
      background: rgba(56, 189, 248, 0.12);
      color: var(--accent);
      font-weight: 700;
      border: 1px solid rgba(56, 189, 248, 0.25);
    }

    .folder-item-left {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      min-width: 0;
    }
    .folder-sub-guide {
      color: var(--text-dim);
      font-size: 0.72rem;
      margin-right: 0.15rem;
      opacity: 0.6;
      font-family: var(--mono);
      flex-shrink: 0;
    }
    .folder-icon-wrap {
      display: flex;
      align-items: center;
      flex-shrink: 0;
    }
    .folder-icon-wrap svg { width: 16px; height: 16px; }

    .folder-label-text {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .folder-badges {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      flex-shrink: 0;
    }
    .badge-unread {
      background: var(--accent);
      color: #ffffff;
      font-size: 0.7rem;
      font-weight: 800;
      border-radius: 10px;
      padding: 0.1rem 0.45rem;
      line-height: 1.2;
    }
    .badge-total {
      font-size: 0.72rem;
      color: var(--text-dim);
    }

    /* Widgets Inferiores da Sidebar */
    .sidebar-footer-widgets {
      margin-top: auto;
      padding-top: 0.75rem;
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      flex-shrink: 0;
    }

    .sidebar-quota-mini {
      background: var(--surface-dim);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.65rem 0.75rem;
    }
    .quota-top-row {
      display: flex;
      justify-content: space-between;
      font-size: 0.74rem;
      color: var(--text-muted);
      margin-bottom: 0.4rem;
      font-weight: 600;
    }
    .quota-bar-track {
      height: 5px;
      background: rgba(255, 255, 255, 0.08);
      border-radius: 3px;
      overflow: hidden;
    }
    .quota-bar-fill {
      height: 100%;
      background: var(--accent-gradient);
      border-radius: 3px;
      transition: width 0.3s ease;
    }
    .quota-bottom-desc {
      font-size: 0.68rem;
      color: var(--text-dim);
      margin-top: 0.35rem;
      font-family: var(--mono);
    }

    .sidebar-user-dock {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
    }
    .user-profile-left {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      min-width: 0;
    }
    .user-avatar-circle {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--accent-gradient);
      color: #ffffff;
      font-weight: 700;
      font-size: 0.82rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .user-dock-info {
      min-width: 0;
    }
    .user-dock-name {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .user-dock-status {
      font-size: 0.68rem;
      color: var(--success);
      display: flex;
      align-items: center;
      gap: 0.3rem;
    }

    .btn-sidebar-logout {
      padding: 0.45rem 0.65rem;
      border-radius: var(--radius-sm);
      border: 1px solid rgba(239, 68, 68, 0.3);
      background: rgba(239, 68, 68, 0.08);
      color: #ef4444;
      font-size: 0.78rem;
      font-weight: 700;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      transition: all 0.15s ease;
      flex-shrink: 0;
    }
    .btn-sidebar-logout:hover {
      background: #ef4444;
      color: #ffffff;
    }
    .btn-sidebar-logout svg { width: 13px; height: 13px; }

    /* ======================================================== */
    /* PAINEL PRINCIPAL (CONTEUDO COMPLETO)                     */
    /* ======================================================== */
    .cloudmail-main-panel {
      flex: 1 1 0;
      min-width: 0;
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .main-panel-card {
      background: var(--surface-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      overflow: hidden;
      width: 100%;
      box-sizing: border-box;
    }

    /* 4. NOVA MENSAGEM NO CONTAINER PRINCIPAL (SEM MODAL) */
    .compose-container-card {
      display: flex;
      flex-direction: column;
    }
    .compose-container-header {
      padding: 1rem 1.5rem;
      background: var(--surface-dim);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .compose-header-left {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      color: var(--text);
    }
    .compose-header-left svg { width: 19px; height: 19px; color: var(--accent); }
    .compose-h2 {
      font-size: 1.15rem;
      font-weight: 700;
    }

    .compose-container-form {
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .compose-field-row {
      display: flex;
      align-items: center;
      border-bottom: 1px solid var(--border);
      padding-bottom: 0.5rem;
    }
    .compose-field-label {
      width: 70px;
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text-muted);
    }
    .compose-field-input {
      flex: 1;
      background: transparent;
      border: none;
      color: var(--text);
      font-size: 0.92rem;
      font-family: inherit;
      outline: none;
      padding: 0.35rem 0.5rem;
    }

    /* BARRA WYSIWYG */
    .wysiwyg-toolbar-box {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.35rem;
      padding: 0.5rem 0.75rem;
      background: var(--surface-dim);
      border: 1px solid var(--border);
      border-bottom: none;
      border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    }
    .wysiwyg-btn {
      width: 28px;
      height: 28px;
      border-radius: 4px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.12s ease;
    }
    .wysiwyg-btn:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: var(--border);
    }
    .wysiwyg-btn svg { width: 14px; height: 14px; }
    .wysiwyg-separator {
      width: 1px;
      height: 18px;
      background: var(--border);
      margin: 0 0.25rem;
    }
    .wysiwyg-select-ctrl {
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text);
      border-radius: 4px;
      font-size: 0.78rem;
      padding: 0.2rem 0.4rem;
      outline: none;
    }

    /* FOLHA DE PAPEL DO EDITOR NO CONTAINER */
    .wysiwyg-paper-sheet {
      min-height: 280px;
      background: #ffffff;
      color: #0f172a;
      border: 1px solid var(--border);
      border-radius: 0 0 var(--radius-sm) var(--radius-sm);
      padding: 1.5rem;
      font-family: inherit;
      font-size: 0.95rem;
      line-height: 1.6;
      outline: none;
      box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
    }
    .wysiwyg-paper-sheet:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 2px var(--accent-glow);
    }

    /* DRAG & DROP DROPZONE */
    .dropzone-container {
      border: 2px dashed rgba(56, 189, 248, 0.35);
      border-radius: var(--radius-sm);
      padding: 1rem;
      background: rgba(56, 189, 248, 0.02);
      text-align: center;
      transition: all 0.2s ease;
      cursor: pointer;
    }
    .dropzone-container.is-dragover {
      border-color: var(--accent);
      background: rgba(56, 189, 248, 0.08);
    }
    .dropzone-text-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      font-size: 0.84rem;
      color: var(--text-dim);
    }
    .dropzone-text-row svg { width: 17px; height: 17px; color: var(--accent); }

    .dropzone-previews-tray {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0.65rem;
    }
    .attachment-pill-preview {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.35rem 0.75rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 6px;
      font-size: 0.78rem;
      color: var(--text);
    }
    .attachment-pill-preview img {
      width: 22px;
      height: 22px;
      border-radius: 3px;
      object-fit: cover;
    }
    .attachment-pill-preview svg { width: 14px; height: 14px; color: var(--accent); }
    .btn-remove-pill {
      background: none;
      border: none;
      color: var(--danger);
      cursor: pointer;
      font-weight: 700;
      padding: 0 2px;
      line-height: 1;
    }

    .compose-container-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 0.5rem;
    }
    .btn-compose-send {
      height: 42px;
      padding: 0 1.5rem;
      border-radius: var(--radius-sm);
      background: var(--accent-gradient);
      color: #ffffff;
      border: none;
      font-size: 0.92rem;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
      transition: all 0.15s ease;
    }
    .btn-compose-send:hover {
      filter: brightness(1.08);
      transform: translateY(-1px);
    }
    .btn-compose-send svg { width: 16px; height: 16px; }

    /* Folder header bar */
    .folder-header-bar {
      padding: 1rem 1.25rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 0.75rem;
    }
    .folder-title-left {
      display: flex;
      align-items: center;
      gap: 0.65rem;
    }
    .folder-title-left svg { color: var(--accent); width: 20px; height: 20px; }
    .folder-h2 {
      font-size: 1.15rem;
      font-weight: 700;
      color: var(--text);
    }
    .folder-stat-badge {
      font-size: 0.78rem;
      color: var(--text-dim);
      background: var(--surface-dim);
      padding: 0.2rem 0.55rem;
      border-radius: 12px;
      border: 1px solid var(--border);
    }

    /* BARRA DE PAGINAÇÃO VISÍVEL E COMPLETA */
    .pagination-toolbar {
      padding: 0.65rem 1.25rem;
      background: var(--surface-dim);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 0.75rem;
      font-size: 0.82rem;
    }
    .pagination-toolbar.bottom {
      border-bottom: none;
      border-top: 1px solid var(--border);
    }
    .pagination-summary {
      color: var(--text-muted);
    }
    .pagination-summary strong { color: var(--text); }

    .pagination-controls {
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }
    .btn-page-step {
      padding: 0.35rem 0.65rem;
      border-radius: var(--radius-sm);
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text);
      text-decoration: none;
      font-size: 0.78rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      transition: all 0.15s ease;
    }
    .btn-page-step:hover:not(.disabled) {
      background: var(--accent);
      color: #ffffff;
      border-color: var(--accent);
    }
    .btn-page-step.disabled {
      opacity: 0.35;
      pointer-events: none;
      cursor: not-allowed;
    }
    .btn-page-step svg { width: 13px; height: 13px; }
    .pagination-page-indicator {
      font-weight: 700;
      color: var(--text);
      padding: 0 0.5rem;
    }

    /* WEBMAIL MESSAGES TABLE STYLES */
    .messages-table-wrap {
      width: 100%;
      overflow-x: auto;
    }
    .messages-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.86rem;
      text-align: left;
    }
    .messages-table thead th {
      padding: 0.65rem 1rem;
      background: var(--surface-dim);
      color: var(--text-dim);
      font-weight: 700;
      font-size: 0.74rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }
    .messages-table tbody tr {
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background 0.1s ease;
    }
    .messages-table tbody tr:hover {
      background: var(--surface-hover);
    }
    .messages-table tbody tr.unread {
      background: rgba(56, 189, 248, 0.03);
      font-weight: 700;
    }
    .messages-table tbody tr.unread .msg-subject-text {
      color: var(--text);
      font-weight: 700;
    }
    .messages-table td {
      padding: 0.75rem 1rem;
      vertical-align: middle;
    }

    .msg-sender-cell {
      max-width: 220px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--text);
    }
    .msg-subject-cell {
      max-width: 550px;
      min-width: 200px;
    }
    .msg-subject-text {
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: inline-block;
      max-width: 100%;
    }
    .msg-snippet-text {
      color: var(--text-dim);
      font-weight: normal;
      margin-left: 0.4rem;
    }
    .msg-date-cell {
      white-space: nowrap;
      color: var(--text-muted);
      font-size: 0.78rem;
      font-family: var(--mono);
      text-align: right;
    }

    .empty-folder-box {
      text-align: center;
      padding: 4rem 1.5rem;
      color: var(--text-dim);
    }
    .empty-folder-box svg { width: 44px; height: 44px; opacity: 0.4; margin-bottom: 0.85rem; }

    /* ======================================================== */
    /* MESSAGE VIEWER STYLES */
    /* ======================================================== */
    .message-view-full {
      width: 100%;
      height: auto;
      min-height: 100%;
      overflow: visible;
      box-sizing: border-box;
    }

    .msg-view-top-toolbar {
      padding: 0.85rem 1.25rem;
      background: var(--surface-dim);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 0.65rem;
    }

    .btn-msg-action {
      height: 34px;
      padding: 0 0.85rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      text-decoration: none;
      font-size: 0.8rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-msg-action:hover {
      background: var(--surface-hover);
      border-color: var(--accent);
      color: var(--accent);
    }
    .btn-msg-action svg { width: 14px; height: 14px; }

    .msg-meta-card {
      padding: 1.5rem 1.75rem;
      border-bottom: 1px solid var(--border);
    }
    .msg-meta-subject-h1 {
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--text);
      line-height: 1.3;
      margin-bottom: 1rem;
      word-break: break-word;
    }
    .msg-meta-details-grid {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 1rem;
    }
    .msg-sender-info-block {
      display: flex;
      align-items: center;
      gap: 0.85rem;
    }
    .msg-sender-avatar {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      background: var(--accent-gradient);
      color: #ffffff;
      font-weight: 800;
      font-size: 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .msg-sender-text-col {
      min-width: 0;
    }
    .msg-from-name {
      font-weight: 700;
      color: var(--text);
      font-size: 0.95rem;
    }
    .msg-from-email {
      font-size: 0.8rem;
      color: var(--text-dim);
    }
    .msg-recipient-row {
      font-size: 0.78rem;
      color: var(--text-muted);
      margin-top: 0.2rem;
    }

    .msg-meta-right-col {
      text-align: right;
    }
    .msg-date-pill {
      font-size: 0.8rem;
      color: var(--text-muted);
      font-family: var(--mono);
      margin-bottom: 0.4rem;
    }
    .msg-security-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.72rem;
      font-weight: 700;
      background: rgba(16, 185, 129, 0.1);
      border: 1px solid rgba(16, 185, 129, 0.3);
      color: var(--success);
      padding: 0.15rem 0.55rem;
      border-radius: 12px;
    }
    .msg-security-chip svg { width: 12px; height: 12px; }

    /* Seção de Anexos da Mensagem */
    .msg-attachments-section {
      padding: 1rem 1.75rem;
      background: var(--surface-dim);
      border-bottom: 1px solid var(--border);
    }
    .attachments-title-bar {
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-dim);
      margin-bottom: 0.65rem;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }
    .attachments-title-bar svg { width: 14px; height: 14px; }
    .attachments-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 0.65rem;
    }
    .attachment-card-item {
      display: inline-flex;
      align-items: center;
      gap: 0.65rem;
      padding: 0.5rem 0.85rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      text-decoration: none;
      color: var(--text);
      font-size: 0.82rem;
      transition: all 0.15s ease;
    }
    .attachment-card-item:hover {
      border-color: var(--accent);
      background: var(--surface-hover);
      color: var(--accent);
    }
    .attachment-card-item svg { width: 16px; height: 16px; }

    /* Corpo do E-mail (Sem barras internas, preenche e rola naturalmente) */
    .msg-body-wrapper {
      padding: 1.75rem;
      width: 100%;
      box-sizing: border-box;
      height: auto;
      min-height: 400px;
      overflow: visible;
    }
    .msg-body-frame {
      width: 100%;
      border: none;
      min-height: 450px;
      background: #ffffff;
      border-radius: var(--radius-sm);
      box-shadow: inset 0 1px 4px rgba(0,0,0,0.06);
    }
    .msg-body-text-fallback {
      font-family: inherit;
      white-space: pre-wrap;
      word-break: break-word;
      line-height: 1.7;
      color: var(--text);
      font-size: 0.95rem;
    }

    /* TOAST ALERTAS */
    .toast-notification {
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      padding: 0.85rem 1.25rem;
      border-radius: var(--radius-sm);
      background: var(--surface-card);
      border: 1px solid var(--border);
      box-shadow: var(--shadow-lg);
      font-size: 0.86rem;
      display: flex;
      align-items: center;
      gap: 0.65rem;
      z-index: 200;
      animation: toastIn 0.2s ease-out;
    }
    @keyframes toastIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .toast-notification.success { border-color: rgba(16, 185, 129, 0.4); color: var(--success); }
    .toast-notification.error { border-color: rgba(239, 68, 68, 0.4); color: var(--danger); }
    .toast-notification svg { width: 18px; height: 18px; }

    /* Utilitários */
    .spin { animation: spin 1s linear infinite; }
    @keyframes spin { 100% { transform: rotate(360deg); } }
      /* ========================================================================= */
    /* MESSAGE VIEW STYLES, TABS AND SECURITY                     */
    /* ========================================================================= */
    .msg-view-top-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      margin-bottom: 1.25rem;
      padding-bottom: 0.85rem;
      border-bottom: 1px solid var(--border);
      flex-wrap: wrap;
    }
    .msg-meta-subject-h1 {
      font-size: 1.5rem;
      font-weight: 800;
      line-height: 1.35;
      margin-bottom: 1.25rem;
      color: var(--text);
      letter-spacing: -0.015em;
    }
    .msg-header-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1.25rem 1.5rem;
      margin-bottom: 1.5rem;
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 1.25rem;
      align-items: center;
    }
    @media (max-width: 820px) {
      .msg-header-card { grid-template-columns: 1fr; }
    }
    .msg-sender-avatar {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
      color: #ffffff;
      font-size: 1.15rem;
      font-weight: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
      flex-shrink: 0;
    }
    .msg-sender-details-col { min-width: 0; }
    .msg-from-name {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--text);
    }
    .msg-from-email {
      font-size: 0.85rem;
      color: var(--text-muted);
      font-family: var(--mono);
      word-break: break-all;
      margin-top: 0.15rem;
    }
    .msg-recipient-row {
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-top: 0.35rem;
    }
    .msg-auth-badges {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0.75rem;
    }
    .badge-chip {
      font-size: 0.72rem;
      font-family: var(--mono);
      padding: 0.22rem 0.6rem;
      border-radius: 6px;
      border: 1px solid transparent;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-weight: 600;
    }
    .badge-chip-pass {
      background: rgba(16, 185, 129, 0.12);
      color: #34d399;
      border-color: rgba(52, 211, 153, 0.3);
    }
    .badge-chip-warn {
      background: rgba(245, 158, 11, 0.12);
      color: #fbbf24;
      border-color: rgba(251, 191, 36, 0.3);
    }
    .badge-chip-fail {
      background: rgba(239, 68, 68, 0.12);
      color: #f87171;
      border-color: rgba(248, 113, 113, 0.3);
    }
    .badge-chip-info {
      background: rgba(56, 189, 248, 0.12);
      color: #38bdf8;
      border-color: rgba(56, 189, 248, 0.3);
    }
    .badge-chip-neutral {
      background: var(--surface-dim);
      color: var(--text-muted);
      border-color: var(--border);
    }
    .msg-meta-right-col {
      text-align: right;
      font-size: 0.85rem;
      color: var(--text-muted);
    }
    .msg-meta-date { color: var(--text); }
    .msg-meta-timerel {
      margin-top: 0.25rem;
      font-weight: 600;
      color: #818cf8;
    }
    .msg-meta-uid {
      margin-top: 0.45rem;
      font-family: var(--mono);
      font-size: 0.78rem;
      color: var(--text-dim);
    }

    /* Message view tabs */
    .msg-tabs-nav {
      display: flex;
      gap: 0.5rem;
      border-bottom: 1px solid var(--border);
      margin-bottom: 1.25rem;
      overflow-x: auto;
    }
    .msg-tab-btn {
      padding: 0.75rem 1.15rem;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .msg-tab-btn:hover { color: var(--text); }
    .msg-tab-btn.active {
      color: #818cf8;
      border-bottom-color: #818cf8;
    }
    .msg-tab-content { display: none; }
    .msg-tab-content.active { display: block; }

    .email-iframe {
      width: 100%;
      min-height: 650px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #ffffff;
      display: block;
    }
    .plain-text-box {
      background: var(--surface-dim);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 1.5rem;
      font-family: var(--mono);
      font-size: 0.88rem;
      line-height: 1.6;
      white-space: pre-wrap;
      word-break: break-word;
      color: var(--text);
    }
    .raw-headers-box {
      background: #020617;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 1.25rem;
      font-family: var(--mono);
      font-size: 0.8rem;
      color: #38bdf8;
      overflow-x: auto;
      line-height: 1.5;
    }

    /* Grade de anexos */
    .attachments-title-bar {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 0.85rem;
    }
    .attachments-grid-cards {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 1rem;
    }
    .att-card-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 0.85rem 1rem;
      border-radius: 8px;
      text-decoration: none;
      color: inherit;
      transition: all 0.15s ease;
    }
    .att-card-item:hover {
      border-color: #818cf8;
      background: var(--surface-dim);
      transform: translateY(-1px);
    }
    .att-card-info { min-width: 0; }
    .att-card-name {
      font-weight: 600;
      font-size: 0.88rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--text);
    }
    .att-card-size {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-family: var(--mono);
      margin-top: 0.2rem;
    }
      /* SPINNER PADRÃO REDONDO (CIRCULAR LOADER) */
    .standard-spinner {
      width: 18px;
      height: 18px;
      animation: standardSpin 0.75s linear infinite;
      display: inline-block;
      vertical-align: middle;
    }
    .standard-spinner circle {
      stroke: currentColor;
      stroke-width: 3;
      fill: none;
    }
    .standard-spinner .spinner-track {
      opacity: 0.25;
    }
    .standard-spinner .spinner-head {
      stroke-dasharray: 38;
      stroke-dashoffset: 12;
      stroke-linecap: round;
    }
    @keyframes standardSpin {
      100% { transform: rotate(360deg); }
    }

    /* Topbar removida conforme solicitado */

    /* BRAND NA SIDEBAR */
    .sidebar-brand-header {
      padding: 0.25rem 0.25rem 0.75rem 0.25rem;
      border-bottom: 1px solid var(--border);
      margin-bottom: 0.75rem;
    }
    .sidebar-brand-header .cloudmail-brand-logo {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      text-decoration: none;
      color: var(--text);
    }
    .brand-icon-box {
      width: 34px;
      height: 34px;
      border-radius: var(--radius-sm);
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(37, 99, 235, 0.2));
      border: 1px solid rgba(56, 189, 248, 0.35);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent);
      flex-shrink: 0;
    }
    .brand-icon-box svg { width: 18px; height: 18px; }
    .brand-text-col {
      display: flex;
      flex-direction: column;
      line-height: 1.15;
    }
    .brand-text-col .brand-name {
      font-weight: 800;
      font-size: 1.1rem;
      letter-spacing: -0.02em;
    }
    .brand-text-col .brand-ver {
      font-size: 0.68rem;
      color: var(--accent);
      font-weight: 600;
    }

    /* SELETOR DE IDIOMAS */
    .lang-selector-wrap {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      background: var(--surface-dim);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0 0.5rem;
      height: 32px;
    }
    .lang-globe-icon {
      width: 14px;
      height: 14px;
      color: var(--text-muted);
    }
    .lang-select-input {
      background: transparent;
      border: none;
      color: var(--text);
      font-size: 0.78rem;
      font-weight: 600;
      cursor: pointer;
      outline: none;
      padding: 0.2rem 0;
    }
    .lang-select-input option {
      background: var(--surface-card);
      color: var(--text);
    }

    /* Action buttons: Read, Unread, Delete */
    .folder-actions-right {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
    .btn-action-pill {
      background: var(--surface-dim);
      border: 1px solid var(--border);
      color: var(--text);
      border-radius: var(--radius-sm);
      padding: 0.35rem 0.75rem;
      font-size: 0.78rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-action-pill:hover {
      background: var(--surface-hover);
      border-color: var(--border-focus);
      color: var(--accent);
    }
    .btn-action-pill svg { width: 14px; height: 14px; }
    .btn-action-pill-danger:hover {
      background: rgba(239, 68, 68, 0.15);
      border-color: #ef4444;
      color: #ef4444;
    }
    .btn-msg-action-danger:hover {
      background: rgba(239, 68, 68, 0.15) !important;
      border-color: #ef4444 !important;
      color: #ef4444 !important;
    }
    /* Correção Global de Ícones SVG */
    svg.lucide, .lucide {
      width: 1em;
      height: 1em;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      display: inline-block;
      vertical-align: middle;
      flex-shrink: 0;
    }
    .field-lead-icon {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      width: 18px !important;
      height: 18px !important;
      color: var(--text-dim) !important;
      pointer-events: none;
    }
    .btn-webmail-submit svg {
      width: 18px !important;
      height: 18px !important;
    }
    .btn-password-toggle svg {
      width: 16px !important;
      height: 16px !important;
    }

    /* Visualizador de Mensagem: Margens e Espaçamento */
    .message-view-full {
      overflow: hidden;
    }
    .msg-view-body-wrapper {
      padding: 1.5rem 1.75rem 2rem 1.75rem;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
      box-sizing: border-box;
    }
    .msg-meta-subject-h1 {
      font-size: 1.4rem;
      font-weight: 800;
      color: var(--text);
      line-height: 1.3;
      margin: 0;
      word-break: break-word;
    }
    .msg-header-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1.15rem 1.35rem;
      margin: 0;
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 1.25rem;
      align-items: center;
    }

    /* Terminal Drawer & Botão Copiar JSON */
    .terminal-header-actions {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .btn-copy-diag-json {
      height: 28px;
      padding: 0 0.65rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-dim);
      color: var(--text);
      font-size: 0.74rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-copy-diag-json:hover {
      background: var(--surface-hover);
      color: var(--accent);
      border-color: var(--accent);
    }
    .btn-copy-diag-json svg { width: 13px; height: 13px; }

                /* Indicador e Banner de Auto-Save de Rascunhos */
    .draft-autosave-indicator {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.73rem;
      color: var(--text-dim);
      background: var(--surface-dim);
      padding: 2px 8px;
      border-radius: 12px;
      border: 1px solid var(--border);
      transition: all 0.2s ease;
      margin-left: 0.75rem;
    }
    .draft-check-icon {
      width: 12px;
      height: 12px;
      color: #10b981;
    }
    .draft-restore-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
      border: 1px solid rgba(99, 102, 241, 0.25);
      border-radius: var(--radius-sm);
      padding: 0.65rem 1rem;
      margin: 0.85rem 1.25rem 0 1.25rem;
      color: var(--text);
      font-size: 0.83rem;
      transition: all 0.2s ease;
    }
    .draft-restore-left {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--text-muted);
    }
    .draft-restore-left svg {
      width: 16px;
      height: 16px;
      color: #818cf8;
      flex-shrink: 0;
    }
    .draft-restore-actions {
      display: flex;
      align-items: center;
      gap: 0.45rem;
    }
    .btn-draft-action-restore {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      background: rgba(99, 102, 241, 0.15);
      border: 1px solid rgba(99, 102, 241, 0.35);
      color: #818cf8;
      font-size: 0.78rem;
      font-weight: 700;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-draft-action-restore:hover {
      background: rgba(99, 102, 241, 0.28);
      border-color: #818cf8;
    }
    .btn-draft-action-restore svg {
      width: 13px;
      height: 13px;
    }
    .btn-draft-action-dismiss {
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      transition: all 0.15s ease;
    }
    .btn-draft-action-dismiss:hover {
      background: var(--surface-hover);
      color: var(--text);
    }
    .btn-draft-action-dismiss svg {
      width: 14px;
      height: 14px;
    }

    /* Banner de Privacidade e Bloqueio de Imagens Externas */
    .privacy-alert-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.04) 100%);
      border: 1px solid rgba(245, 158, 11, 0.25);
      border-radius: var(--radius-sm);
      padding: 0.65rem 1rem;
      margin: 1.15rem 0 0.85rem 0;
      color: var(--text);
      font-size: 0.83rem;
      transition: all 0.2s ease;
    }
    .privacy-alert-left {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      color: var(--text-muted);
      line-height: 1.4;
    }
    .privacy-icon {
      color: #f59e0b;
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }
    .btn-load-images {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      background: rgba(245, 158, 11, 0.15);
      border: 1px solid rgba(245, 158, 11, 0.35);
      color: #d97706;
      font-size: 0.78rem;
      font-weight: 700;
      padding: 0.4rem 0.85rem;
      border-radius: var(--radius-sm);
      cursor: pointer;
      flex-shrink: 0;
      transition: all 0.15s ease;
    }
    [data-theme="dark"] .btn-load-images {
      color: #fbbf24;
    }
    .btn-load-images:hover {
      background: rgba(245, 158, 11, 0.28);
      border-color: #f59e0b;
    }
    .btn-load-images svg {
      width: 14px;
      height: 14px;
    }

    /* Hierarchical folder tree with expand/collapse */
    .sidebar-section-title-left {
      display: flex;
      align-items: center;
      gap: 0.45rem;
    }
    .badge-total-count {
      background: var(--surface-dim);
      border: 1px solid var(--border);
      color: var(--text-muted);
      font-size: 0.68rem;
      padding: 1px 6px;
      border-radius: 10px;
    }
    .folder-tree-tools {
      display: flex;
      align-items: center;
      gap: 0.25rem;
    }
    .btn-tree-action {
      background: transparent;
      border: 1px solid transparent;
      border-radius: 4px;
      color: var(--text-dim);
      width: 22px;
      height: 22px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-tree-action:hover {
      background: var(--surface-hover);
      color: var(--accent);
      border-color: var(--border);
    }
    .btn-tree-action svg {
      width: 13px;
      height: 13px;
    }
    .folder-item-row {
      display: flex;
      align-items: center;
      border-radius: var(--radius-sm);
      transition: background 0.15s ease;
      position: relative;
      width: 100%;
    }
    .folder-item-row:hover {
      background: var(--surface-hover);
    }
    .folder-item-row.active {
      background: var(--surface-hover);
    }
    .folder-tree-node {
      list-style: none;
      transition: all 0.15s ease;
    }
    .btn-folder-toggle {
      background: transparent;
      border: none;
      width: 20px;
      height: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      cursor: pointer;
      padding: 0;
      flex-shrink: 0;
      transition: transform 0.2s ease, color 0.15s ease;
      z-index: 2;
    }
    .btn-folder-toggle:hover {
      color: var(--accent);
    }
    .btn-folder-toggle svg {
      width: 14px;
      height: 14px;
      transition: transform 0.2s ease;
    }
    .folder-sub-guide {
      width: 18px;
      height: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-dim);
      font-size: 0.8rem;
      font-family: var(--mono);
      opacity: 0.65;
      flex-shrink: 0;
      margin-right: 2px;
    }
    .folder-root-bullet {
      width: 6px;
      flex-shrink: 0;
    }
    .folder-tree-node.is-collapsed > .folder-item-row .btn-folder-toggle svg {
      transform: rotate(-90deg);
    }
    .folder-tree-node.is-hidden {
      display: none !important;
    }
    .folder-tree-node .folder-item-link {
      flex: 1;
      min-width: 0;
      padding: 0.44rem 0.5rem;
    }

    /* Compose recipient toggle tools (Cc, Bcc, Reply-To) */
    .compose-recipient-tools {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      margin-left: 0.5rem;
      flex-shrink: 0;
    }
    .btn-recip-toggle {
      height: 26px;
      padding: 0 0.55rem;
      border-radius: 4px;
      border: 1px solid var(--border);
      background: var(--surface-dim);
      color: var(--text-dim);
      font-size: 0.72rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-recip-toggle:hover, .btn-recip-toggle.active {
      background: var(--surface-hover);
      color: var(--accent);
      border-color: var(--accent);
    }

    /* ========================================================
       ITEM 8: ATALHOS DE TECLADO E DESTAQUE VISUAL (POWER USER)
       ======================================================== */
    .messages-table tbody tr.keyboard-focus-row {
      outline: 2px solid var(--accent, #38bdf8) !important;
      outline-offset: -2px;
      background: rgba(56, 189, 248, 0.12) !important;
      box-shadow: inset 4px 0 0 var(--accent, #38bdf8) !important;
    }

    .shortcuts-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.68);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      z-index: 99999;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1rem;
      animation: fadeInShortcuts 0.15s ease-out;
    }
    @keyframes fadeInShortcuts {
      from { opacity: 0; transform: scale(0.98); }
      to { opacity: 1; transform: scale(1); }
    }
    .shortcuts-modal-card {
      background: var(--surface, #1e293b);
      border: 1px solid var(--border, #334155);
      border-radius: 12px;
      width: 100%;
      max-width: 620px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
      overflow: hidden;
    }
    .shortcuts-modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1rem 1.25rem;
      border-bottom: 1px solid var(--border, #334155);
      background: var(--surface-dim, #0f172a);
    }
    .shortcuts-modal-close {
      background: transparent;
      border: none;
      font-size: 1.6rem;
      line-height: 1;
      color: var(--text-dim, #94a3b8);
      cursor: pointer;
      padding: 0 0.3rem;
      transition: color 0.15s;
    }
    .shortcuts-modal-close:hover {
      color: var(--text, #f8fafc);
    }
    .shortcuts-modal-body {
      padding: 1.25rem;
      max-height: 72vh;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }
    .shortcuts-section-title {
      font-size: 0.76rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--accent, #38bdf8);
      margin-bottom: 0.65rem;
    }
    .shortcuts-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 0.6rem;
    }
    .shortcut-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.45rem 0.65rem;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 6px;
    }
    .shortcut-keys {
      display: flex;
      align-items: center;
      gap: 0.3rem;
    }
    .shortcut-keys kbd, .shortcuts-modal-footer kbd {
      background: var(--surface-dim, #0f172a);
      border: 1px solid var(--border, #475569);
      border-bottom-width: 2px;
      border-radius: 4px;
      padding: 0.15rem 0.45rem;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.74rem;
      font-weight: 700;
      color: var(--text, #f8fafc);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    .shortcut-desc {
      font-size: 0.82rem;
      color: var(--text-dim, #94a3b8);
    }
    .shortcuts-modal-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.85rem 1.25rem;
      border-top: 1px solid var(--border, #334155);
      background: var(--surface-dim, #0f172a);
      font-size: 0.8rem;
      color: var(--text-dim, #94a3b8);
    }

    /* ========================================================
       ITEM 9: CONTAINER DE TOASTS & NOTIFICAÇÕES (POLLING LIVE)
       ======================================================== */
    .email-toast-container {
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      z-index: 99998;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      max-width: 380px;
      pointer-events: none;
    }
    .email-toast {
      pointer-events: auto;
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid rgba(56, 189, 248, 0.4);
      border-radius: 12px;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.2);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      padding: 1rem 1.15rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      transition: all 0.25s ease;
    }
    @keyframes toastSlideIn {
      from { opacity: 0; transform: translateY(20px) scale(0.95); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    .email-toast-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .email-toast-badge {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      color: var(--accent, #38bdf8);
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .email-toast-badge-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--accent, #38bdf8);
      box-shadow: 0 0 8px var(--accent, #38bdf8);
      animation: pulseDot 1.5s infinite;
    }
    @keyframes pulseDot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.4; transform: scale(0.85); }
    }
    .email-toast-close {
      background: transparent;
      border: none;
      color: var(--text-dim, #94a3b8);
      cursor: pointer;
      padding: 0.2rem;
      font-size: 1.25rem;
      line-height: 1;
      transition: color 0.15s;
    }
    .email-toast-close:hover {
      color: #fff;
    }
    .email-toast-body {
      font-size: 0.86rem;
      color: var(--text, #f8fafc);
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }
    .email-toast-from {
      font-weight: 700;
      color: #fff;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .email-toast-subject {
      color: var(--text-dim, #94a3b8);
      font-size: 0.82rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .email-toast-action-btn {
      margin-top: 0.35rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      background: var(--accent-gradient, linear-gradient(135deg, #0284c7, #38bdf8));
      color: #ffffff;
      border: none;
      border-radius: 6px;
      padding: 0.45rem 0.85rem;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      transition: filter 0.15s, transform 0.1s;
      text-decoration: none;
    }
    .email-toast-action-btn:hover {
      filter: brightness(1.15);
      transform: translateY(-1px);
    }

    /* ========================================================
       ITEM 10: RESPONSIVIDADE MOBILE & MENU DRAWER RETRÁTIL
       ======================================================== */
    .mobile-topbar {
      display: none;
      align-items: center;
      justify-content: space-between;
      padding: 0.75rem 1rem;
      background: var(--surface-card);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 50;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    .mobile-topbar-left {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .btn-mobile-hamburger {
      background: var(--surface-dim);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      width: 38px;
      height: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
    }
    .btn-mobile-hamburger:hover {
      background: var(--surface-hover);
      border-color: var(--accent);
    }
    .btn-mobile-hamburger svg { width: 20px; height: 20px; }
    .mobile-brand-link {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      text-decoration: none;
      color: var(--text);
      font-weight: 700;
      font-size: 1.05rem;
    }
    .btn-mobile-quick-compose {
      background: var(--accent-gradient);
      color: #fff;
      border: none;
      border-radius: var(--radius-sm);
      width: 38px;
      height: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
      text-decoration: none;
      transition: filter 0.15s;
    }
    .btn-mobile-quick-compose:hover {
      filter: brightness(1.1);
    }
    .btn-mobile-quick-compose svg { width: 18px; height: 18px; }

    .btn-close-mobile-drawer {
      display: none;
      background: transparent;
      border: none;
      color: var(--text-dim);
      cursor: pointer;
      padding: 0.4rem;
      border-radius: 6px;
      transition: color 0.15s, background 0.15s;
    }
    .btn-close-mobile-drawer:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.08);
    }
    .btn-close-mobile-drawer svg { width: 20px; height: 20px; }

    .sidebar-drawer-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      z-index: 99990;
      opacity: 0;
      transition: opacity 0.25s ease;
      pointer-events: none;
    }
    .sidebar-drawer-backdrop.active {
      opacity: 1;
      pointer-events: auto;
    }

    /* MEDIA QUERY PARA TELAS <= 1024px (TABLETS E CELULARES) */
    @media (max-width: 1024px) {
      .mobile-topbar {
        display: flex;
      }
      .sidebar-drawer-backdrop {
        display: block;
      }
      .btn-close-mobile-drawer {
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .cloudmail-app-shell {
        padding: 0;
      }
      .cloudmail-workspace {
        display: block;
        padding: 0.75rem;
      }
      .cloudmail-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        max-height: 100vh !important;
        width: 300px !important;
        min-width: 300px !important;
        border-radius: 0 !important;
        border-top: none !important;
        border-bottom: none !important;
        border-left: none !important;
        z-index: 100000 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.7) !important;
      }
      .cloudmail-sidebar.open-drawer {
        transform: translateX(0);
      }
      .cloudmail-main-panel {
        width: 100%;
      }
      .folder-header-bar {
        padding: 0.85rem 1rem;
      }
    }

    /* MEDIA QUERY PARA TELAS <= 768px (SMARTPHONES) */
    @media (max-width: 768px) {
      .folder-search-wrap {
        width: 100%;
        max-width: 100%;
        order: 3;
      }
      .folder-actions-right {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.25rem;
      }

      /* TRANSFORMAÇÃO DA TABELA DE E-MAILS EM CARDS RESPONSIVOS TOUCH */
      .messages-table-wrap {
        overflow-x: hidden;
      }
      .messages-table thead {
        display: none;
      }
      .messages-table, 
      .messages-table tbody, 
      .messages-table tbody tr {
        display: block;
        width: 100%;
      }
      .messages-table tbody tr {
        padding: 0.85rem 1rem;
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        border-bottom: 1px solid var(--border);
      }
      .messages-table td {
        padding: 0 !important;
        display: block;
        max-width: 100% !important;
      }
      .messages-table tbody tr td:first-child {
        position: absolute;
        top: 0.85rem;
        right: 1rem;
        z-index: 2;
      }
      .msg-sender-cell {
        font-size: 0.92rem;
        font-weight: 700;
        color: var(--text);
        padding-right: 2.5rem !important;
      }
      .msg-subject-cell {
        font-size: 0.85rem;
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
      }
      .msg-subject-text {
        color: var(--text);
      }
      .msg-snippet-text {
        font-size: 0.78rem;
        color: var(--text-dim);
      }
      .msg-date-cell {
        font-size: 0.75rem;
        color: var(--text-dim);
        text-align: left !important;
      }
      
      /* Open message detail view */
      .msg-view-top-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
      }
      .msg-view-top-toolbar > div {
        flex-wrap: wrap;
      }
      .btn-msg-action {
        flex: 1 1 auto;
        justify-content: center;
      }

      /* Tela de Composição */
      .compose-header-left, .compose-header-right {
        width: 100%;
        justify-content: space-between;
      }
      .compose-container-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
      }
    }

    /* ========================================================
       ITEM 11: REFINAMENTOS DE CONTRASTE NO LIGHT THEME
       ======================================================== */
    body, .cloudmail-sidebar, .main-panel-card, .login-system-card {
      transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }

    [data-theme="light"] .shortcuts-modal-card {
      background: #ffffff;
      border-color: #cbd5e1;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    }
    [data-theme="light"] .shortcuts-modal-header,
    [data-theme="light"] .shortcuts-modal-footer {
      background: #f8fafc;
      border-color: #e2e8f0;
    }
    [data-theme="light"] .shortcut-item {
      background: #f8fafc;
      border-color: #e2e8f0;
    }
    [data-theme="light"] .shortcut-keys kbd, 
    [data-theme="light"] .shortcuts-modal-footer kbd {
      background: #ffffff;
      border-color: #cbd5e1;
      color: #0f172a;
    }
    [data-theme="light"] .email-toast {
      background: rgba(255, 255, 255, 0.97);
      border-color: rgba(2, 132, 199, 0.35);
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 0 15px rgba(2, 132, 199, 0.12);
    }
    [data-theme="light"] .email-toast-from {
      color: #0f172a;
    }
    [data-theme="light"] .email-toast-subject {
      color: #475569;
    }
    [data-theme="light"] .messages-table tbody tr.keyboard-focus-row {
      background: rgba(2, 132, 199, 0.1) !important;
      outline: 2px solid #0284c7 !important;
      box-shadow: inset 4px 0 0 #0284c7 !important;
    }
    [data-theme="light"] .messages-table tbody tr.unread {
      background: rgba(2, 132, 199, 0.04);
    }
    [data-theme="light"] .messages-table thead th {
      background: #f1f5f9;
      color: #475569;
      border-bottom-color: #cbd5e1;
    }
    [data-theme="light"] .messages-table tbody tr:hover {
      background: #f1f5f9;
    }

    /* ========================================================
       ITEM 12: ESTILOS DO VISUALIZADOR DE ANEXOS (LIGHTBOX)
       ======================================================== */
    .att-card-item {
      display: flex;
      align-items: center;
      gap: 0.85rem;
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 0.75rem 1rem;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      position: relative;
    }
    .att-card-item:hover {
      border-color: #818cf8;
      background: var(--surface-dim);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
      transform: translateY(-1px);
    }
    .att-card-lead-icon {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      background: rgba(129, 140, 248, 0.12);
      color: #818cf8;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .att-card-lead-icon i {
      width: 18px;
      height: 18px;
    }
    .att-card-actions {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      margin-left: auto;
      flex-shrink: 0;
    }
    .btn-att-action-icon {
      width: 30px;
      height: 30px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      text-decoration: none;
      transition: all 0.15s ease;
    }
    .btn-att-action-icon:hover {
      background: #818cf8;
      color: #ffffff;
      border-color: #818cf8;
    }
    .btn-att-action-icon i {
      width: 14px;
      height: 14px;
    }

    /* Modal Backdrop */
    .att-lightbox-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      animation: attFadeIn 0.2s ease forwards;
    }
    .att-lightbox-backdrop.active {
      display: flex;
    }
    @keyframes attFadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    .att-lightbox-window {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      width: 94vw;
      max-width: 1100px;
      height: 88vh;
      max-height: 850px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
      animation: attSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    @keyframes attSlideUp {
      from { transform: scale(0.96) translateY(10px); opacity: 0; }
      to { transform: scale(1) translateY(0); opacity: 1; }
    }

    .att-lightbox-header {
      padding: 0.85rem 1.25rem;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-shrink: 0;
    }
    .att-lightbox-meta {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      min-width: 0;
    }
    .att-lightbox-icon-wrap {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      background: rgba(129, 140, 248, 0.15);
      color: #818cf8;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .att-lightbox-icon-wrap i {
      width: 18px;
      height: 18px;
    }
    .att-lightbox-title-wrap {
      min-width: 0;
    }
    .att-lightbox-title {
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--text);
      margin: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 480px;
    }
    .att-lightbox-size {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-family: var(--mono);
    }
    .att-lightbox-controls {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-shrink: 0;
    }
    .btn-att-lightbox-action {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.45rem 0.85rem;
      border-radius: 6px;
      font-size: 0.82rem;
      font-weight: 500;
      text-decoration: none;
      color: var(--text);
      background: var(--surface-dim);
      border: 1px solid var(--border);
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .btn-att-lightbox-action:hover {
      background: var(--surface);
      border-color: #818cf8;
      color: #818cf8;
    }
    .btn-att-lightbox-action.primary {
      background: #818cf8;
      color: #ffffff;
      border-color: #818cf8;
    }
    .btn-att-lightbox-action.primary:hover {
      background: #6366f1;
    }
    .btn-att-lightbox-action.close {
      padding: 0.45rem;
      color: var(--text-muted);
    }
    .btn-att-lightbox-action.close:hover {
      color: #ef4444;
      border-color: rgba(239, 68, 68, 0.4);
    }
    .btn-att-lightbox-action i {
      width: 15px;
      height: 15px;
    }

    .att-lightbox-body {
      flex: 1;
      position: relative;
      background: #090d16;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }
    [data-theme="light"] .att-lightbox-body {
      background: #f1f5f9;
    }
    .att-lightbox-img-wrap {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      overflow: auto;
    }
    .att-lightbox-img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      border-radius: 6px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
      animation: attFadeIn 0.25s ease;
    }
    .att-lightbox-frame {
      width: 100%;
      height: 100%;
      border: none;
      background: #ffffff;
    }
    .att-lightbox-spinner {
      display: flex;
      align-items: center;
      justify-content: center;
      color: #818cf8;
    }
