﻿/* ============================================================
   VORTEX — Clean Dashboard Theme (Light + Dark toggle)
   ============================================================ */

/* ---- CSS Variables (Light — default) ---- */
:root {
  --bg-app: #F5F5F7;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #FAFAFA;
  --bg-sidebar: rgba(255, 255, 255, 0.65);
  --bg-inset: #F0F0F3;

  --border: #E5E5EA;
  --border-light: #F0F0F3;
  --border-hover: #D1D1D6;

  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-muted: #AEAEB2;
  --text-inverse: #FFFFFF;

  --accent: #0071E3;
  --accent-hover: #0077ED;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --accent-medium: rgba(0, 113, 227, 0.12);

  --success: #34C759;
  --success-soft: rgba(52, 199, 89, 0.1);
  --warning: #FF9F0A;
  --error: #FF3B30;
  --error-soft: rgba(255, 59, 48, 0.08);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1), 0 8px 20px rgba(0, 0, 0, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Glass */
  --header-bg: rgba(255, 255, 255, 0.72);
  --header-border: rgba(0, 0, 0, 0.06);
  --header-hover: rgba(0, 0, 0, 0.04);
  --sidebar-border: rgba(0, 0, 0, 0.06);
  --sidebar-hover: rgba(0, 0, 0, 0.04);
  --sidebar-active-bg: rgba(0, 113, 227, 0.08);
  --sidebar-text: #1D1D1F;
  --sidebar-text-muted: #6E6E73;
}

/* ---- Dark Mode Variables ---- */
[data-theme="dark"] {
  --bg-app: #0F0F0F;
  --bg-surface: #1A1A1A;
  --bg-surface-hover: #222222;
  --bg-sidebar: rgba(30, 30, 30, 0.75);
  --bg-inset: #111111;

  /* Glass (dark) */
  --header-bg: rgba(20, 20, 20, 0.72);
  --header-border: rgba(255, 255, 255, 0.06);
  --header-hover: rgba(255, 255, 255, 0.06);
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: rgba(10, 132, 255, 0.15);
  --sidebar-text: #F5F5F7;
  --sidebar-text-muted: #8E8E93;

  --border: #2A2A2A;
  --border-light: #1F1F1F;
  --border-hover: #3A3A3A;

  --text-primary: #F5F5F7;
  --text-secondary: #8E8E93;
  --text-muted: #48484A;
  --text-inverse: #FFFFFF;

  --accent: #0A84FF;
  --accent-hover: #409CFF;
  --accent-soft: rgba(10, 132, 255, 0.12);
  --accent-medium: rgba(10, 132, 255, 0.18);

  --success: #30D158;
  --success-soft: rgba(48, 209, 88, 0.12);
  --error: #FF453A;
  --error-soft: rgba(255, 69, 58, 0.12);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ---- Base ---- */
html, :host {
  font-family: var(--font) !important;
}

[data-theme="dark"] { color-scheme: dark; }

body {
  background-color: var(--bg-app) !important;
  color: var(--text-primary) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ---- Theme Toggle Button ---- */
#__theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
  padding: 0;
}

#__theme-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

#__theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

#__theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* ---- Main Background Overrides ---- */
.bg-gray-100,
.min-h-screen.bg-gray-100 {
  background-color: var(--bg-app) !important;
}

.bg-gray-50 {
  background-color: var(--bg-inset) !important;
}

/* ---- White surfaces ---- */
.bg-white {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  backdrop-filter: none !important;
}

/* ---- Shadows ---- */
.shadow {
  box-shadow: var(--shadow-sm) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-md) !important;
}

.shadow-xl {
  box-shadow: var(--shadow-lg) !important;
}

.hover\:shadow-lg:hover {
  box-shadow: var(--shadow-lg) !important;
}

/* ---- Border Radius ---- */
.rounded-xl {
  border-radius: var(--radius-lg) !important;
}

.rounded-lg {
  border-radius: var(--radius-md) !important;
}

/* ---- Text Colors ---- */
.text-gray-800 { color: var(--text-primary) !important; }
.text-gray-700 { color: var(--text-primary) !important; }
.text-gray-600 { color: var(--text-secondary) !important; }
.text-gray-500 { color: var(--text-secondary) !important; }
.text-gray-400 { color: var(--text-muted) !important; }
.text-gray-300 { color: var(--text-muted) !important; }

/* ---- Sidebar (Glass) ---- */
aside,
aside.bg-white {
  background: var(--bg-sidebar) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-right: 1px solid var(--sidebar-border) !important;
  border-left: none !important;
  border-top: none !important;
  border-bottom: none !important;
  width: 260px !important;
  padding: 20px 14px !important;
  display: flex !important;
  flex-direction: column !important;
}

aside h2,
aside .text-lg.font-bold {
  color: var(--sidebar-text) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  padding: 0 8px !important;
  margin-bottom: 12px !important;
}

aside nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

aside nav a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 10px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 14px !important;
  font-weight: 450 !important;
  color: var(--sidebar-text-muted) !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
  background: transparent !important;
  border: none !important;
}

aside nav a:hover {
  background: var(--sidebar-hover) !important;
  color: var(--sidebar-text) !important;
}

aside nav a svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  stroke-width: 1.75 !important;
  color: inherit !important;
}

aside nav a.bg-blue-50,
aside nav a.bg-blue-100,
aside nav a[class*="bg-blue"] {
  background: var(--sidebar-active-bg) !important;
  color: var(--accent) !important;
  font-weight: 500 !important;
}

aside nav a.bg-blue-50 svg,
aside nav a.bg-blue-100 svg,
aside nav a[class*="bg-blue"] svg {
  color: var(--accent) !important;
}

aside .w-full.bg-blue-600,
aside button.bg-blue-600,
aside button[class*="bg-blue-600"] {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.2s ease !important;
  margin-top: 8px !important;
}

aside .w-full.bg-blue-600:hover,
aside button.bg-blue-600:hover {
  background: var(--accent-hover) !important;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3) !important;
}

aside .mt-auto,
aside .border-t {
  border-color: var(--sidebar-border) !important;
  padding-top: 14px !important;
  margin-top: auto !important;
}

aside .flex.items-center .w-8.h-8,
aside .w-8.h-8.bg-blue-100.rounded-full {
  background: var(--sidebar-hover) !important;
  border: none !important;
  border-radius: 50% !important;
}

aside .text-sm.font-medium {
  color: var(--sidebar-text) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

aside .text-xs.text-gray-500 {
  color: var(--sidebar-text-muted) !important;
  font-size: 11px !important;
}

aside a[href="/"] {
  color: var(--sidebar-text-muted) !important;
  font-size: 13px !important;
  padding: 8px 10px !important;
  border-radius: var(--radius-sm) !important;
  transition: all 0.15s ease !important;
}

aside a[href="/"]:hover {
  color: var(--sidebar-text) !important;
  background: var(--sidebar-hover) !important;
}

/* Sidebar top section (.p-4.border-b) */
aside .p-4.border-b {
  border-color: var(--sidebar-border) !important;
}

aside .p-4.border-b a.text-gray-600,
aside .p-4.border-b .text-gray-600 {
  color: var(--sidebar-text-muted) !important;
}

aside .p-4.border-b a.text-gray-600:hover,
aside .p-4.border-b .text-gray-600:hover {
  color: var(--sidebar-text) !important;
}

aside .p-4.border-b a.text-gray-600 svg,
aside .p-4.border-b .text-gray-600 svg {
  color: inherit !important;
}

aside .p-4.border-b .font-medium.text-gray-800,
aside .p-4.border-b .font-medium,
aside .p-4.border-b p.text-gray-800 {
  color: var(--sidebar-text) !important;
}

aside .p-4.border-b .text-xs.text-gray-500,
aside .p-4.border-b p.text-gray-500 {
  color: var(--sidebar-text-muted) !important;
}

aside .p-4.border-b .bg-blue-100.rounded-full,
aside .p-4.border-b .w-10.h-10.bg-blue-100 {
  background: var(--sidebar-hover) !important;
}

aside .p-4.border-b .text-blue-600,
aside .p-4.border-b .bg-blue-100 svg {
  color: var(--accent) !important;
}

/* ---- Primary Buttons ---- */
.bg-blue-600 {
  background: var(--accent) !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-inverse) !important;
  transition: all 0.2s ease !important;
}

.bg-blue-600:hover,
.hover\:bg-blue-700:hover {
  background: var(--accent-hover) !important;
  box-shadow: var(--shadow-xs) !important;
}

.bg-blue-600.text-white,
.flex.items-center.bg-blue-600.text-white {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
}

/* ---- Secondary / Ghost Buttons ---- */
.flex-1.px-4.py-2.border.border-gray-300.text-gray-700 {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  transition: all 0.15s ease !important;
}

.flex-1.px-4.py-2.border.border-gray-300.text-gray-700:hover,
.hover\:bg-gray-50:hover {
  background: var(--bg-inset) !important;
}

.flex.items-center.px-3.py-2.bg-white.border {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
}

.flex.items-center.px-3.py-2.bg-white.border:hover {
  background: var(--bg-inset) !important;
  color: var(--text-primary) !important;
}

/* ---- Green button (Compose) ---- */
.bg-green-50 { background: var(--success-soft) !important; }
.text-green-600 { color: var(--success) !important; }
.hover\:bg-green-100:hover { background: rgba(52, 199, 89, 0.16) !important; }

/* ---- Caixa de Entrada card button ---- */
.flex-1.flex.items-center.justify-center.bg-blue-50.text-blue-600 {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  transition: all 0.15s ease !important;
}

.flex-1.flex.items-center.justify-center.bg-blue-50.text-blue-600:hover {
  background: var(--accent-medium) !important;
}

/* ---- Inputs ---- */
input, textarea, select {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  transition: all 0.15s ease !important;
  font-size: 14px !important;
}

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

input:focus, textarea:focus, select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
  outline: none !important;
}

.rounded-l-lg {
  border-top-left-radius: var(--radius-sm) !important;
  border-bottom-left-radius: var(--radius-sm) !important;
}

.rounded-r-lg {
  border-top-right-radius: var(--radius-sm) !important;
  border-bottom-right-radius: var(--radius-sm) !important;
}

.px-4.py-2.bg-gray-100.border.border-l-0.border-gray-300.rounded-r-lg.text-gray-600 {
  background: var(--bg-inset) !important;
  border: 1px solid var(--border) !important;
  border-left: 0 !important;
  color: var(--text-muted) !important;
  font-size: 13px !important;
}

/* ---- Borders ---- */
.border { border-color: var(--border) !important; }
.border-gray-300 { border-color: var(--border) !important; }
.border-b { border-color: var(--border-light) !important; }
.border-b-2.border-blue-500 { border-color: var(--accent) !important; }
.divide-y > :not([hidden]) ~ :not([hidden]) { border-color: var(--border-light) !important; }

/* ---- Cards ---- */
.bg-white.rounded-xl.shadow,
.bg-white.rounded-xl.shadow-xl {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  backdrop-filter: none !important;
  transition: all 0.2s ease !important;
}

.bg-white.rounded-xl.shadow:hover {
  border-color: var(--border-hover) !important;
  box-shadow: var(--shadow-md) !important;
}

/* ---- Avatar circles ---- */
.bg-blue-100.rounded-full,
.w-12.h-12.bg-blue-100.rounded-full,
.w-10.h-10.bg-blue-100.rounded-full {
  background: var(--accent-soft) !important;
  border: none !important;
}

.w-6.h-6.text-blue-600,
.w-4.h-4.text-blue-600 { color: var(--accent) !important; }
.w-5.h-5.text-blue-600,
.w-8.h-8.text-blue-600 { color: var(--accent) !important; }

/* ---- Modal (Criar Email) ---- */
.fixed.inset-0.bg-black.bg-opacity-50 {
  background: rgba(0, 0, 0, 0.25) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

[data-theme="dark"] .fixed.inset-0.bg-black.bg-opacity-50 {
  background: rgba(0, 0, 0, 0.5) !important;
}

.bg-white.rounded-xl.shadow-xl.w-full.max-w-md.p-6 {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-xl) !important;
  backdrop-filter: none !important;
  padding: 28px !important;
  border-radius: var(--radius-xl) !important;
  max-width: 400px !important;
  animation: modalSlideIn 0.2s ease-out !important;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bg-white.rounded-xl.shadow-xl .text-xl.font-bold.text-gray-800 {
  color: var(--text-primary) !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 20px !important;
}

.bg-white.rounded-xl.shadow-xl .space-y-4 > * + * {
  margin-top: 16px !important;
}

.bg-white.rounded-xl.shadow-xl .block.text-sm.font-medium {
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  margin-bottom: 6px !important;
}

.bg-white.rounded-xl.shadow-xl .flex input {
  padding: 10px 14px !important;
  font-size: 14px !important;
}

.bg-white.rounded-xl.shadow-xl .flex.space-x-3 {
  gap: 10px !important;
  padding-top: 6px !important;
}

.bg-white.rounded-xl.shadow-xl .flex.space-x-3 button[type="button"] {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
}

.bg-white.rounded-xl.shadow-xl .flex.space-x-3 button[type="button"]:hover {
  background: var(--bg-inset) !important;
  color: var(--text-primary) !important;
}

.bg-white.rounded-xl.shadow-xl .flex.space-x-3 button[type="submit"] {
  background: var(--accent) !important;
  border: none !important;
  color: white !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
}

.bg-white.rounded-xl.shadow-xl .flex.space-x-3 button[type="submit"]:hover {
  background: var(--accent-hover) !important;
}

.bg-white.rounded-xl.shadow-xl .text-xs.text-gray-500 {
  color: var(--text-muted) !important;
  margin-top: 6px !important;
}

/* ---- Error/Alert ---- */
.bg-red-100 { background: var(--error-soft) !important; }
.border-red-400 { border-color: rgba(255, 59, 48, 0.2) !important; }
.text-red-700 { color: var(--error) !important; }
.text-red-600 { color: var(--error) !important; }
.hover\:text-red-500:hover,
.hover\:text-red-600:hover { color: #FF6961 !important; }

.text-gray-400.hover\:text-red-500 {
  color: var(--text-muted) !important;
}

.text-gray-400.hover\:text-red-500:hover {
  color: var(--error) !important;
}

/* ---- Spinner ---- */
.animate-spin {
  border-color: transparent !important;
  border-bottom-color: var(--accent) !important;
}

/* ---- Empty State ---- */
.p-8.text-center .text-gray-400,
.p-8.text-center .text-gray-300 {
  color: var(--border) !important;
}

.text-xl.font-semibold.text-gray-700 {
  color: var(--text-secondary) !important;
}

/* ---- Labels ---- */
.block.text-sm.font-medium.text-gray-700 { color: var(--text-secondary) !important; }
.text-sm.font-medium.text-gray-700 { color: var(--text-secondary) !important; }
.text-xs.text-gray-500 { color: var(--text-muted) !important; }
.text-xs.text-gray-400 { color: var(--text-muted) !important; }

/* ---- Email list header ---- */
.px-6.py-4.border-b.bg-gray-50 {
  background: var(--bg-inset) !important;
  border-color: var(--border-light) !important;
}

/* ---- Prose ---- */
.prose { color: var(--text-primary) !important; line-height: 1.7; }
.prose a { color: var(--accent) !important; }
.whitespace-pre-wrap.font-sans.text-gray-700 { color: var(--text-primary) !important; }

/* ---- Back/nav links ---- */
.flex.items-center.text-gray-600.hover\:text-gray-900 {
  color: var(--text-secondary) !important;
}

.flex.items-center.text-gray-600.hover\:text-gray-900:hover {
  color: var(--text-primary) !important;
}

/* ---- Focus ---- */
.focus\:ring-2:focus,
.focus\:ring-blue-500:focus {
  --tw-ring-color: var(--accent-soft) !important;
}

.focus\:border-transparent:focus {
  border-color: var(--accent) !important;
}

/* ---- Transitions ---- */
button, [role="button"], a { transition: all 0.15s ease !important; }
.transition-colors { transition: all 0.15s ease !important; }
.transition-shadow { transition: all 0.2s ease !important; }

/* ---- Grid → List Layout (Leads style) ---- */
.grid.gap-4 {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
}

.grid.gap-4.md\:grid-cols-2 {
  grid-template-columns: none !important;
}

.grid.gap-4.md\:grid-cols-2.lg\:grid-cols-3 {
  grid-template-columns: none !important;
}

/* Card → Row item */
.grid.gap-4 > div {
  border: none !important;
  border-bottom: 1px solid var(--border-light) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background 0.15s ease !important;
}

.grid.gap-4 > div:last-child {
  border-bottom: none !important;
}

.grid.gap-4 > div:hover {
  background: var(--bg-inset) !important;
  border-color: var(--border-light) !important;
  box-shadow: none !important;
}

/* Remove card shadow classes on list items */
.grid.gap-4 > .bg-white.rounded-xl.shadow.hover\:shadow-lg {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  border-bottom: 1px solid var(--border-light) !important;
  background: transparent !important;
}

.grid.gap-4 > .bg-white.rounded-xl.shadow.hover\:shadow-lg:hover {
  box-shadow: none !important;
  background: var(--bg-inset) !important;
  border-color: var(--border-light) !important;
}

.grid.gap-4 > .bg-white.rounded-xl.shadow.hover\:shadow-lg::before {
  content: none !important;
}

/* Card inner padding — more compact row */
.grid.gap-4 > div .p-6 {
  padding: 14px 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

/* Header row (avatar + name + delete) — inline */
.grid.gap-4 .flex.items-start.justify-between.mb-4 {
  margin-bottom: 0 !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Avatar — smaller for list */
.grid.gap-4 .w-12.h-12.bg-blue-100.rounded-full {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  flex-shrink: 0 !important;
}

.grid.gap-4 .w-12.h-12.bg-blue-100.rounded-full svg {
  width: 18px !important;
  height: 18px !important;
}

/* Name + email inline */
.grid.gap-4 .ml-3 {
  margin-left: 12px !important;
  min-width: 0 !important;
}

.grid.gap-4 .font-semibold.text-gray-800 {
  font-size: 14px !important;
  font-weight: 550 !important;
}

.grid.gap-4 .text-sm.text-gray-500 {
  font-size: 12.5px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Badge — smaller in list */
.grid.gap-4 .novo-badge {
  font-size: 9px !important;
  padding: 1px 6px !important;
}

/* Action buttons — compact row layout */
.grid.gap-4 .flex.space-x-2 {
  gap: 6px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
}

.grid.gap-4 .flex-1.flex.items-center.justify-center.bg-blue-50.text-blue-600 {
  flex: 0 0 auto !important;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  border-radius: 6px !important;
  gap: 6px !important;
}

.grid.gap-4 .flex-1.flex.items-center.justify-center.bg-blue-50.text-blue-600 svg {
  width: 14px !important;
  height: 14px !important;
  margin-right: 4px !important;
}

.grid.gap-4 .flex.items-center.justify-center.bg-green-50.text-green-600 {
  padding: 7px 10px !important;
  border-radius: 6px !important;
}

.grid.gap-4 .flex.items-center.justify-center.bg-green-50.text-green-600 svg {
  width: 14px !important;
  height: 14px !important;
}

/* Delete button — aligned with action buttons */
.grid.gap-4 .text-gray-400.hover\:text-red-500 {
  opacity: 0;
  transition: opacity 0.15s ease !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  order: 99 !important;
  align-self: center !important;
}

.grid.gap-4 > div:hover .text-gray-400.hover\:text-red-500 {
  opacity: 1;
}

.grid.gap-4 .text-gray-400.hover\:text-red-500 svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
}

/* Move delete button visually next to action buttons */
.grid.gap-4 > div .p-6 .flex.items-start.justify-between.mb-4 .text-gray-400.hover\:text-red-500 {
  position: absolute !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.grid.gap-4 > div .p-6 .flex.items-start.justify-between.mb-4 {
  position: relative !important;
}

/* ---- List Table Header (replaced by JS injected header) ---- */
.grid.gap-4::before {
  content: none !important;
  display: none !important;
}

/* Injected header row */
.__list-header {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 10px 20px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
  background: var(--bg-inset) !important;
  border-bottom: 1px solid var(--border) !important;
  user-select: none;
}

.__list-header span {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- Checkboxes ---- */
.__row-check,
.__header-check {
  -webkit-appearance: none;
  appearance: none;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  border: 1.5px solid var(--border-hover) !important;
  border-radius: 5px !important;
  background: var(--bg-surface) !important;
  cursor: pointer !important;
  position: relative !important;
  transition: all 0.15s ease !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}

.__row-check:hover,
.__header-check:hover {
  border-color: var(--accent) !important;
}

.__row-check:checked,
.__header-check:checked {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

.__row-check:checked::after,
.__header-check:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Row selected state */
.__row-selected {
  background: var(--accent-soft) !important;
}

.__row-selected:hover {
  background: var(--accent-medium) !important;
}

/* ---- Selection Action Bar ---- */
#__select-bar {
  position: fixed;
  bottom: -70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px 10px 18px;
  box-shadow: var(--shadow-xl);
  min-width: 380px;
  transition: bottom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font);
}

[data-theme="dark"] #__select-bar {
  background: #1A1A1A;
  border-color: #2A2A2A;
}

#__select-bar.__sbar-visible {
  bottom: 24px;
}

.__sbar-left {
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.__sbar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.__sbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.__sbar-cancel {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  font-family: var(--font);
}

.__sbar-cancel:hover {
  background: var(--bg-inset);
  color: var(--text-primary);
}

.__sbar-delete {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: var(--error);
  color: white;
  transition: all 0.15s ease;
  font-family: var(--font);
}

.__sbar-delete:hover {
  background: #E0352B;
}

[data-theme="dark"] .__sbar-delete {
  background: var(--error-soft);
  color: var(--error);
}

[data-theme="dark"] .__sbar-delete:hover {
  background: rgba(255, 69, 58, 0.2);
}

/* ---- Card hover (clean) ---- */
.bg-white.rounded-xl.shadow.hover\:shadow-lg {
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.bg-white.rounded-xl.shadow.hover\:shadow-lg::before {
  content: none;
}

.bg-white.rounded-xl.shadow.hover\:shadow-lg:hover {
  border-color: var(--border-hover) !important;
  box-shadow: var(--shadow-md) !important;
}

/* ---- Disabled ---- */
.disabled\:opacity-50:disabled { opacity: 0.4 !important; }
.text-white { color: var(--text-inverse) !important; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--border-hover); }

/* ---- Selection ---- */
::selection { background-color: var(--accent-soft); color: var(--accent); }

/* ---- Fade-in ---- */
#root { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- Typography ---- */
h1, h2, h3 { letter-spacing: -0.025em; color: var(--text-primary) !important; }
.text-2xl.font-bold, .text-xl.font-bold { font-weight: 600 !important; }
.font-semibold.text-gray-800 { color: var(--text-primary) !important; }
.font-medium.text-gray-800 { color: var(--text-primary) !important; }

/* ---- Page Header (Glass) ---- */
header.bg-white.shadow,
header.bg-white {
  background: var(--header-bg) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: none !important;
  border-bottom: 1px solid var(--header-border) !important;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06) !important;
}

header .text-xl.font-bold.text-gray-800,
header h1 {
  color: var(--text-primary) !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}

header .w-8.h-8.text-blue-600 {
  color: var(--accent) !important;
}

.text-2xl.font-bold.text-gray-800 {
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}

/* "Criar Email" top button — pill style */
.flex.items-center.bg-blue-600.text-white.px-4.py-2 {
  border-radius: var(--radius-sm) !important;
  padding: 9px 18px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  gap: 6px !important;
}

.flex.items-center.bg-blue-600.text-white.px-4.py-2 svg {
  width: 16px !important;
  height: 16px !important;
}

/* ---- Email Detail Page ---- */

/* Header buttons (Voltar, Responder, Archive, Delete) */
header .flex.items-center.text-gray-600,
header button.flex.items-center.text-gray-600,
header a.flex.items-center.text-gray-600 {
  color: var(--text-secondary) !important;
}

header .flex.items-center.text-gray-600:hover,
header button.flex.items-center.text-gray-600:hover,
header a.flex.items-center.text-gray-600:hover {
  color: var(--text-primary) !important;
  background: var(--header-hover) !important;
}

header .flex.items-center.text-gray-600 svg,
header button.flex.items-center.text-gray-600 svg {
  color: inherit !important;
}

header .flex.items-center.space-x-2 button {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
}

header .flex.items-center.space-x-2 button:hover {
  color: var(--text-primary) !important;
  background: var(--header-hover) !important;
}

header .flex.items-center.space-x-2 button svg {
  color: inherit !important;
}

/* Email detail card */
.min-h-screen.bg-gray-100 main .bg-white.rounded-xl.shadow {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
}

/* Email subject */
.min-h-screen.bg-gray-100 main .p-6.border-b .text-2xl.font-semibold.text-gray-800 {
  color: var(--text-primary) !important;
  font-weight: 650 !important;
  letter-spacing: -0.02em !important;
}

/* Email sender info */
.min-h-screen.bg-gray-100 main .p-6.border-b {
  border-color: var(--border-light) !important;
  background: var(--bg-surface) !important;
}

.min-h-screen.bg-gray-100 main .p-6.border-b .font-medium.text-gray-800 {
  color: var(--text-primary) !important;
}

.min-h-screen.bg-gray-100 main .p-6.border-b .text-sm.text-gray-500 {
  color: var(--text-secondary) !important;
}

.min-h-screen.bg-gray-100 main .p-6.border-b span.text-sm.text-gray-500 {
  color: var(--text-muted) !important;
}

/* Sender avatar */
.min-h-screen.bg-gray-100 main .p-6.border-b .w-12.h-12.bg-blue-100.rounded-full {
  background: var(--accent-soft) !important;
}

.min-h-screen.bg-gray-100 main .p-6.border-b .w-12.h-12.bg-blue-100.rounded-full svg {
  color: var(--accent) !important;
}

/* Email body area */
.min-h-screen.bg-gray-100 main .p-6 .prose {
  color: var(--text-primary) !important;
}

/* Compose page & email page — background */
.min-h-screen.bg-gray-100 {
  background: var(--bg-app) !important;
}

.min-h-screen.bg-gray-100 main {
  padding-top: 24px !important;
}

/* ---- NOVO Badge ---- */
.novo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: white;
  background: var(--accent);
  border-radius: 5px;
  white-space: nowrap;
  line-height: 1.6;
  animation: none;
  box-shadow: none;
}

/* ---- Custom Modal ---- */
.__modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: all 0.2s ease;
  padding: 16px;
}

.__modal-overlay.__modal-visible {
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

[data-theme="dark"] .__modal-overlay.__modal-visible {
  background: rgba(0, 0, 0, 0.5);
}

.__modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: all 0.2s ease;
  text-align: center;
}

.__modal-visible .__modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.__modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: var(--radius-md);
  background: var(--error-soft);
  border: 1px solid rgba(255, 59, 48, 0.12);
}

.__modal-icon svg { stroke: var(--error) !important; }

.__modal-title {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.__modal-msg {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}

.__modal-btns { display: flex; gap: 8px; }

.__modal-btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.__modal-btn-cancel {
  background: var(--bg-inset);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.__modal-btn-cancel:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.__modal-btn-ok { background: var(--accent); color: white; }
.__modal-btn-ok:hover { background: var(--accent-hover); }

.__modal-btn-danger { background: var(--error); color: white; }
.__modal-btn-danger:hover { background: #E0352B; }

[data-theme="dark"] .__modal-btn-danger {
  background: var(--error-soft);
  color: var(--error);
}

[data-theme="dark"] .__modal-btn-danger:hover {
  background: rgba(255, 69, 58, 0.2);
}
