/* Kalsites Mail — estilos (paleta do site kalsites.com.br) */
:root {
  /* Tema escuro (padrão, igual ao site) */
  --bg: #05050f;
  --panel: #0a0a1c;
  --panel-2: #10102a;
  --hover: #151533;
  --selected: #1b1a44;
  --border: rgba(255, 255, 255, .09);
  --text: #ecebff;
  --muted: #9d9cc0;
  --faint: #6f6e92;
  --violet: #8b5cf6;
  --violet-light: #a78bfa;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --brand: #8b5cf6;
  --brand-hover: #a78bfa;
  --brand-ink: #ffffff;
  --brand-soft: rgba(139, 92, 246, .18);
  --gradient: linear-gradient(120deg, #8b5cf6 0%, #22d3ee 100%);
  --danger: #ff6b6b;
  --danger-soft: #3a1d26;
  --ok: #4cc38a;
  --ok-soft: #15301f;
  --warn: #f0b04a;
  --warn-soft: #33270f;
  --shadow: 0 4px 20px rgba(0, 0, 0, .35), 0 18px 50px rgba(0, 0, 0, .45);
  --glow: 0 0 40px rgba(139, 92, 246, .35);
  --radius: 12px;
  --topbar: 56px;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

/* Tema claro (opcional, em Configurações) */
:root[data-theme="light"] {
  --bg: #f4f4fb;
  --panel: #ffffff;
  --panel-2: #f1f0fa;
  --hover: #ecebf8;
  --selected: #e9e4ff;
  --border: #e3e1f0;
  --text: #17162b;
  --muted: #5f5e80;
  --faint: #8c8bab;
  --brand: #7c4ff0;
  --brand-hover: #6a3fe0;
  --brand-soft: #ece6ff;
  --danger: #d33a3a;
  --danger-soft: #fdecec;
  --ok: #18794e;
  --ok-soft: #e6f6ee;
  --warn: #a15c00;
  --warn-soft: #fff4e0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .08);
  --glow: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand, .login-card h1 { font-family: var(--font-display); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  cursor: pointer; white-space: nowrap; text-decoration: none; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--gradient); border-color: transparent; color: var(--brand-ink); box-shadow: 0 6px 18px rgba(139, 92, 246, .28); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.active { color: var(--brand); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); outline: none;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 8px 0 0 8px; }
.input-group .addon {
  display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border); border-left: 0;
  background: var(--panel-2); color: var(--muted); border-radius: 0 8px 8px 0;
}
.input-group .select { border-radius: 0 8px 8px 0; border-left: 0; width: auto; min-width: 150px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }

/* ---------- Login ---------- */
.login-wrap {
  position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: #05050f url("/brand/fundo.jpg") center / cover no-repeat; color: #ecebff; color-scheme: dark;
}
.login-wrap::before { content: ""; position: absolute; inset: 0; background: radial-gradient(1200px 700px at 50% 50%, rgba(5, 5, 15, .15), rgba(5, 5, 15, .55)); pointer-events: none; }
.login-card {
  position: relative; width: 100%; max-width: 400px; padding: 36px 30px 30px;
  background: rgba(10, 10, 28, .72); border: 1px solid rgba(255, 255, 255, .1); border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 60px rgba(139, 92, 246, .14);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.login-card .logo { display: block; width: 190px; max-width: 70%; height: auto; margin: 0 auto 22px; }
.login-card h1 { font-size: 24px; line-height: 1.2; margin: 0 0 6px; text-align: center; color: #ecebff; }
.login-card h1 em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card p { margin: 0 0 22px; text-align: center; color: #9d9cc0; }
.login-card .field label { color: #cfcde8; }
.login-card .input {
  height: 44px; background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); color: #ecebff; border-radius: 12px;
}
.login-card .input::placeholder { color: #6f6e92; }
.login-card .input:focus { border-color: rgba(167, 139, 250, .7); box-shadow: 0 0 0 3px rgba(139, 92, 246, .22); background: rgba(255, 255, 255, .07); }
.login-card .check { color: #9d9cc0; }
.login-card .btn.primary { width: 100%; height: 46px; margin-top: 6px; font-size: 15px; border-radius: 999px; }
.login-card .alert.error { background: rgba(255, 107, 107, .14); color: #ff8a8a; }
.login-card .alert.info { background: rgba(139, 92, 246, .16); color: #ecebff; }
.login-foot { margin-top: 20px; text-align: center; font-size: 12.5px; color: #6f6e92; }
.login-foot a { color: #a78bfa; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand img.mark { display: none; width: 30px; height: 30px; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--brand-soft); color: var(--text); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-rows: var(--topbar) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--border); min-width: 0;
}
.topbar .menu-btn { display: none; }
.search {
  flex: 1; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid transparent;
}
.search:focus-within { border-color: var(--brand); background: var(--panel); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.user-btn {
  display: flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer;
  padding: 4px 6px; border-radius: 10px; max-width: 260px;
}
.user-btn:hover { background: var(--hover); }
.user-btn .who { text-align: left; min-width: 0; }
.user-btn .who b, .user-btn .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .who span { font-size: 12px; color: var(--muted); }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 0; }
.sidebar {
  overflow-y: auto; padding: 14px 10px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar .compose-btn { height: 44px; margin: 0 4px 12px; border-radius: 12px; font-size: 15px; box-shadow: var(--shadow); }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; font-weight: 700; color: var(--brand); }
.nav-sep { height: 1px; background: var(--border); margin: 10px 6px; }
.nav-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 6px 10px 4px; display: flex; align-items: center; justify-content: space-between; }
.nav-title button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.quota { margin: auto 6px 0; padding-top: 14px; font-size: 12px; color: var(--muted); }
.quota .bar { height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin-top: 6px; }
.quota .bar i { display: block; height: 100%; background: var(--brand); }

.content { min-height: 0; display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); }
.content.page-mode { display: block; overflow-y: auto; }

/* ---------- Lista ---------- */
.list-pane { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--border); }
.list-head {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border); min-height: 52px;
}
.list-head h2 { font-size: 16px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-head .count { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.bulkbar { display: flex; align-items: center; gap: 2px; flex: 1; }
.list { flex: 1; overflow-y: auto; }
.msg-row {
  display: grid; grid-template-columns: 22px 36px minmax(0, 1fr); gap: 10px; padding: 10px 12px 10px 10px;
  border-bottom: 1px solid var(--border); cursor: pointer; position: relative;
}
.msg-row:hover { background: var(--hover); }
.msg-row.active { background: var(--selected); }
.msg-row.unread::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.msg-row input[type=checkbox] { margin: 10px 0 0 4px; cursor: pointer; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 700; font-size: 14px; text-transform: uppercase;
}
.avatar.lg { width: 42px; height: 42px; font-size: 16px; }
.msg-main { min-width: 0; }
.msg-line1 { display: flex; align-items: baseline; gap: 8px; }
.msg-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-date { font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
.msg-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row.unread .msg-from, .msg-row.unread .msg-subject { font-weight: 700; color: var(--text); }
.msg-icons { display: inline-flex; gap: 4px; color: var(--faint); flex: none; }
.msg-icons svg { width: 14px; height: 14px; }
.msg-icons .flag { color: #e5484d; }
.list-empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.list-more { padding: 14px; text-align: center; }

/* ---------- Leitura ---------- */
.reader { min-height: 0; display: flex; flex-direction: column; background: var(--panel); }
.reader-empty { flex: 1; display: grid; place-items: center; color: var(--faint); text-align: center; padding: 20px; }
.reader-empty svg { width: 64px; height: 64px; opacity: .5; }
.reader-toolbar { display: flex; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--border); min-height: 52px; flex-wrap: wrap; }
.reader-toolbar .back { display: none; }
.reader-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.reader-head h1 { font-size: 20px; line-height: 1.3; margin: 0 0 14px; word-break: break-word; }
.sender { display: flex; gap: 12px; align-items: flex-start; }
.sender .info { flex: 1; min-width: 0; }
.sender .from-name { font-weight: 600; }
.sender .from-email { color: var(--muted); font-size: 13px; }
.sender .to-line { color: var(--muted); font-size: 13px; margin-top: 2px; word-break: break-word; }
.sender .date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.images-note { display: flex; align-items: center; gap: 10px; margin: 12px 20px 0; padding: 8px 12px; border-radius: 8px; background: var(--panel-2); font-size: 13px; }
.reader-body { flex: 1; min-height: 240px; display: flex; flex-direction: column; padding: 12px 12px 0; }
.reader-body iframe { flex: 1; width: 100%; border: 0; border-radius: 8px; background: #fff; min-height: 300px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.attachment {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: var(--text); max-width: 280px; background: var(--panel);
}
.attachment:hover { background: var(--hover); }
.attachment .ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 800; flex: none; text-transform: uppercase; }
.attachment .meta { min-width: 0; }
.attachment .meta b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment .meta span { font-size: 12px; color: var(--muted); }

/* ---------- Menus e diálogos ---------- */
.menu {
  position: fixed; z-index: 80; min-width: 200px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; max-height: 70vh; overflow-y: auto;
}
.menu button, .menu a {
  display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; text-align: left;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text); text-decoration: none; font-size: 14px;
}
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu .menu-head { padding: 8px 10px; font-size: 12px; color: var(--muted); }

.overlay { position: fixed; inset: 0; background: rgba(10, 14, 22, .45); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal {
  width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--panel);
  border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px 6px; }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { padding: 10px 18px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; flex-wrap: wrap; }

/* ---------- Escrever ---------- */
.compose {
  position: fixed; right: 24px; bottom: 0; z-index: 50; width: min(680px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 72px));
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px 14px 0 0; box-shadow: var(--shadow);
}
.compose.maximized { right: 50%; transform: translateX(50%); width: min(1000px, calc(100vw - 32px)); height: calc(100dvh - 48px); bottom: 24px; border-radius: 14px; }
.compose-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; background: var(--panel-2); border-radius: 14px 14px 0 0; }
.compose-head b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-fields { padding: 4px 16px 0; }
.compose-line { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); min-height: 40px; }
.compose-line label { color: var(--muted); width: 54px; flex: none; font-size: 13px; }
.compose-line input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 38px; }
.compose-line .toggles button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px; }
.compose-line .toggles button:hover { color: var(--text); }
.editor-toolbar { display: flex; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.editor-toolbar .icon-btn { width: 32px; height: 32px; }
.editor {
  flex: 1; overflow-y: auto; padding: 14px 16px; outline: none; line-height: 1.55; word-wrap: break-word;
}
.editor:empty::before { content: attr(data-placeholder); color: var(--faint); }
.editor blockquote { margin: 0 0 0 .8ex; border-left: 2px solid var(--border); padding-left: 1ex; color: var(--muted); }
.editor img { max-width: 100%; }
.compose-attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 6px 4px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); font-size: 12.5px;
}
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 2px; }
.chip.uploading { opacity: .7; }
.chip .pct { color: var(--brand); font-weight: 600; }
.compose-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }

/* ---------- Páginas (admin, ajustes) ---------- */
.page { max-width: 1060px; margin: 0 auto; padding: 24px 20px 48px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; flex: 1; min-width: 200px; }
.page-head .crumbs { width: 100%; font-size: 13px; color: var(--muted); }
.page-head .crumbs a { text-decoration: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.card .big { font-size: 28px; font-weight: 700; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; margin: 0; flex: 1; }
.panel-body { padding: 16px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--panel-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .value { max-width: 420px; word-break: break-all; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--brand-soft); color: var(--brand); }
.badge.neutral { background: var(--panel-2); color: var(--muted); }
.copy-cell { display: flex; align-items: flex-start; gap: 6px; }
.copy-cell code { flex: 1; min-width: 0; word-break: break-all; }
.usage { min-width: 120px; }
.usage .bar { height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin-top: 4px; }
.usage .bar i { display: block; height: 100%; background: var(--brand); }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-all; }
.signature-editor { min-height: 90px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; outline: none; }
.signature-editor:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- Avisos ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow);
  font-size: 14px; display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 32px));
}
.toast.error { background: #b42318; }
.toast.ok { background: #146c43; }
.toast button { border: 0; background: none; color: #9cc1ff; cursor: pointer; font-weight: 600; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }

/* ---------- Celular e tablet ---------- */
@media (max-width: 1100px) {
  .content { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .topbar { padding: 0 8px; gap: 6px; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar .brand img.word { display: none; }
  .topbar .brand img.mark { display: block; }
  .user-btn .who { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--topbar); bottom: 0; left: 0; width: min(300px, 86vw); z-index: 40;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .app.drawer-open .sidebar { transform: none; }
  .drawer-backdrop { position: fixed; inset: var(--topbar) 0 0 0; background: rgba(10, 14, 22, .4); z-index: 35; }
  .content { grid-template-columns: minmax(0, 1fr); }
  .app[data-pane="reader"] .list-pane { display: none; }
  .app[data-pane="list"] .reader { display: none; }
  .reader-toolbar .back { display: inline-grid; }
  .reader-head { padding: 14px 14px 10px; }
  .reader-head h1 { font-size: 18px; }
  .sender { flex-wrap: wrap; }
  .sender .date { order: 3; flex-basis: 100%; padding-left: 54px; margin-top: 2px; }
  .sender .from-email { display: block; word-break: break-all; }
  .fab {
    position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30;
    height: 54px; padding: 0 20px; border-radius: 16px; border: 0; background: var(--brand); color: var(--brand-ink);
    display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; box-shadow: var(--shadow); cursor: pointer;
  }
  .fab svg { width: 20px; height: 20px; }
  .app[data-pane="reader"] .fab { display: none; }
  .reader-body { padding: 8px 6px 0; }
  .attachments { padding: 10px 14px 14px; }
  .compose, .compose.maximized {
    inset: 0; right: 0; transform: none; width: 100%; height: 100%; height: 100dvh; border-radius: 0; bottom: 0;
  }
  .compose-head { border-radius: 0; }
  .page { padding: 16px 12px 40px; }
  table.data th, table.data td { padding: 9px 10px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 900px) {
  .drawer-backdrop { display: none; }
  .fab { display: none; }
}
