/* Tema inspirado nas cores padrão do Obsidian (dark/light). */
:root,
:root[data-theme="dark"] {
  --background-primary: #1e1e1e;
  --background-primary-alt: #242424;
  --background-secondary: #262626;
  --background-secondary-alt: #363636;
  --background-modifier-border: #363636;
  --background-modifier-border-hover: #474747;
  --background-modifier-hover: rgba(255, 255, 255, 0.075);
  --background-modifier-active: rgba(255, 255, 255, 0.12);
  --background-modifier-form-field: #2a2a2a;
  --text-normal: #dadada;
  --text-muted: #b3b3b3;
  --text-faint: #666666;
  --text-on-accent: #ffffff;
  --interactive-accent: #7f6df2;
  --interactive-accent-hover: #8875ff;
  --text-accent: #a88bfa;
  --link-color: #a88bfa;
  --link-unresolved-opacity: 0.7;
  --tag-color: #a88bfa;
  --tag-background: rgba(127, 109, 242, 0.15);
  --code-background: #2a2a2a;
  --code-normal: #dadada;
  --blockquote-border: #7f6df2;
  --h1-color: #dadada;
  --callout-todo: 2, 122, 255;
  --callout-info: 2, 122, 255;
  --callout-warning: 236, 117, 0;
  --callout-tip: 83, 223, 221;
  --graph-node: #a3a3a3;
  --graph-node-unresolved: #555555;
  --graph-node-tag: #3fb68b;
  --graph-node-focused: #a88bfa;
  --graph-line: #3c3c3c;
  --graph-line-highlight: #7f6df2;
  --graph-text: #dadada;
  --graph-background: #1e1e1e;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --font-interface: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-monospace: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius-s: 4px;
  --radius-m: 8px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --background-primary: #ffffff;
  --background-primary-alt: #fafafa;
  --background-secondary: #f6f6f6;
  --background-secondary-alt: #e3e3e3;
  --background-modifier-border: #e0e0e0;
  --background-modifier-border-hover: #d0d0d0;
  --background-modifier-hover: rgba(0, 0, 0, 0.06);
  --background-modifier-active: rgba(0, 0, 0, 0.1);
  --background-modifier-form-field: #ffffff;
  --text-normal: #222222;
  --text-muted: #5c5c5c;
  --text-faint: #ababab;
  --interactive-accent: #7f6df2;
  --interactive-accent-hover: #6c5ce7;
  --text-accent: #705dcf;
  --link-color: #705dcf;
  --tag-color: #705dcf;
  --tag-background: rgba(127, 109, 242, 0.1);
  --code-background: #f5f4f4;
  --code-normal: #222222;
  --h1-color: #222222;
  --graph-node: #8a8a8a;
  --graph-node-unresolved: #cfcfcf;
  --graph-node-tag: #2a9d6f;
  --graph-node-focused: #705dcf;
  --graph-line: #dcdcdc;
  --graph-line-highlight: #7f6df2;
  --graph-text: #222222;
  --graph-background: #ffffff;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--background-primary);
  color: var(--text-normal);
  font-family: var(--font-interface);
  font-size: 14px;
  overflow: hidden;
}
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.75; }
input, textarea, select, button { font-family: inherit; font-size: 13px; color: var(--text-normal); }
/* todo campo de texto (text, email, password, number...). Antes, email e password ficavam sem estilo. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),
textarea, select {
  background: var(--background-modifier-form-field);
  border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-s);
  padding: 6px 8px;
  min-height: 32px;
  outline: none;
}
@media (max-width: 767.98px) {
  /* 16px: o Safari do iPhone dá zoom ao focar campos menores */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),
  textarea, select { font-size: 16px; }
}
input:focus, textarea:focus, select:focus { border-color: var(--interactive-accent); box-shadow: 0 0 0 2px rgba(127, 109, 242, 0.25); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--background-modifier-border); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; width: 100vw; }
.ribbon {
  width: 44px; flex: 0 0 44px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 0; background: var(--background-secondary); border-right: 1px solid var(--background-modifier-border);
}
.ribbon-spacer { flex: 1; }
.ribbon-btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0;
  color: var(--text-muted); border-radius: var(--radius-s); cursor: pointer; text-decoration: none;
}
.ribbon-btn { width: 32px; height: 32px; }
.icon-btn { width: 26px; height: 26px; }
.icon-btn svg.lucide { width: 16px; height: 16px; }
.ribbon-btn:hover, .icon-btn:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.ribbon-btn.is-active { color: var(--text-accent); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }

.sidebar { background: var(--background-secondary); display: flex; flex-direction: column; min-width: 0; }
.sidebar-left { width: 260px; flex: 0 0 260px; border-right: 1px solid var(--background-modifier-border); }
.sidebar-left.collapsed { display: none; }
.sidebar-right { width: 420px; flex: 0 0 auto; border-left: 1px solid var(--background-modifier-border); }
.resize-handle { width: 4px; cursor: col-resize; background: transparent; margin-right: -4px; z-index: 5; }
.resize-handle:hover, .resize-handle.dragging { background: var(--interactive-accent); }

.workspace-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--background-primary); }
.tab-header {
  height: 40px; flex: 0 0 40px; display: flex; align-items: flex-end; padding: 0 8px;
  background: var(--background-secondary); border-bottom: 1px solid var(--background-modifier-border);
}
.tab {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px; height: 32px; border-radius: 8px 8px 0 0;
  color: var(--text-muted); font-size: 13px;
}
.tab svg.lucide { width: 14px; height: 14px; }
.tab.is-active { background: var(--background-primary); color: var(--text-normal); }
.tab-header-spacer { flex: 1; }
.vault-badge { align-self: center; color: var(--text-faint); font-size: 12px; }

/* ---------- left sidebar ---------- */
.side-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.nav-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 6px 14px; }
.nav-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.nav-buttons { display: flex; gap: 2px; }
.file-tree, .search-results, .tag-list { flex: 1; overflow-y: auto; padding: 0 6px 12px; }
.tree-item {
  display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: var(--radius-s);
  color: var(--text-muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px;
}
.tree-item:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.tree-item.is-active { background: var(--background-modifier-active); color: var(--text-normal); }
.tree-item svg.lucide { width: 14px; height: 14px; flex: 0 0 14px; }
.tree-folder > .tree-item { color: var(--text-normal); }
.tree-folder.collapsed > .tree-children { display: none; }
.tree-folder.collapsed > .tree-item .chevron { transform: rotate(-90deg); }
.tree-children { padding-left: 12px; border-left: 1px solid var(--background-modifier-border); margin-left: 12px; }
.chevron { transition: transform .1s; }
.tree-toggle { display: inline-flex; align-items: center; margin-left: -4px; border-radius: var(--radius-s); }
.tree-toggle:hover { background: var(--background-modifier-hover); }
.tree-count { margin-left: auto; padding-left: 6px; color: var(--text-faint); font-size: 11px; }

.search-box { position: relative; margin: 0 10px 8px; }
.search-box svg { position: absolute; left: 8px; top: 7px; width: 15px; height: 15px; color: var(--text-faint); }
.search-box input { width: 100%; padding-left: 28px; }
.search-result { padding: 6px 8px; border-radius: var(--radius-s); cursor: pointer; }
.search-result:hover { background: var(--background-modifier-hover); }
.search-result .sr-title { color: var(--text-normal); font-size: 13px; }
.search-result .sr-path { color: var(--text-faint); font-size: 11px; }
.search-result .sr-snippet { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.search-result mark { background: rgba(127, 109, 242, 0.35); color: inherit; border-radius: 2px; }
.tag-row { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: var(--radius-s); cursor: pointer; }
.tag-row:hover { background: var(--background-modifier-hover); }
.tag-row .count { color: var(--text-faint); font-size: 12px; }

.vault-switcher {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--background-modifier-border);
  color: var(--text-muted);
}
.vault-switcher select { flex: 1; min-width: 0; font-weight: 600; background: transparent; border-color: transparent; }
.vault-switcher select:hover { background: var(--background-modifier-hover); }
.vault-switcher option { background: var(--background-secondary); }

/* ---------- graph ---------- */
.graph-container { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--graph-background); }
#graph { position: absolute; inset: 0; }
.graph-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.graph-controls {
  position: absolute; top: 10px; right: 10px; width: 250px; z-index: 3;
  background: var(--background-secondary); border: 1px solid var(--background-modifier-border);
  border-radius: var(--radius-m); box-shadow: var(--shadow);
}
.graph-controls-head { display: flex; justify-content: flex-end; gap: 2px; padding: 4px; }
.graph-controls:not(.open) { width: auto; }
.graph-controls-body { padding: 0 12px 10px; max-height: calc(100vh - 140px); overflow-y: auto; }
.graph-controls details { border-top: 1px solid var(--background-modifier-border); padding: 6px 0; }
.graph-controls summary { cursor: pointer; font-weight: 600; color: var(--text-normal); padding: 4px 0; font-size: 13px; }
.graph-controls input[type="search"] { width: 100%; margin: 4px 0; }
.toggle-row, .slider-row { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 12px; padding: 4px 0; gap: 8px; }
.slider-row { flex-direction: column; align-items: stretch; }
input[type="range"] { accent-color: var(--interactive-accent); width: 100%; }
input[type="checkbox"] { accent-color: var(--interactive-accent); }
.legend { display: flex; flex-direction: column; gap: 3px; padding: 4px 0; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- right sidebar / note ---------- */
.note-toolbar {
  height: 40px; flex: 0 0 40px; display: flex; align-items: center; gap: 2px; padding: 0 8px;
  border-bottom: 1px solid var(--background-modifier-border);
}
.note-toolbar-title { flex: 1; min-width: 0; text-align: center; color: var(--text-faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-faint); text-align: center; padding: 24px; }
.note-empty svg.lucide { width: 36px; height: 36px; margin-bottom: 8px; }
.note-panel { flex: 1; min-height: 0; display: flex; background: var(--background-primary); }
.note-scroll { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.inline-title { font-size: 1.8em; font-weight: 700; margin: 0 0 4px; color: var(--h1-color); line-height: 1.2; word-break: break-word; }
.note-meta { color: var(--text-faint); font-size: 12px; margin-bottom: 14px; }
.note-parent { display: flex; align-items: center; gap: 4px; color: var(--text-faint); font-size: 12px; margin-bottom: 4px; }
.note-parent svg.lucide { width: 14px; height: 14px; }
.note-parent a { color: var(--link-color); text-decoration: none; cursor: pointer; }
.note-parent a:hover { text-decoration: underline; }
.btn-small { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 10px; font-size: 12px; background: transparent; }
.btn-small svg.lucide { width: 14px; height: 14px; }
.hint { color: var(--text-faint); font-size: 11px; }

.metadata-container { margin-bottom: 16px; }
.metadata-container:empty { display: none; }
.metadata-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.metadata-property { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 4px 6px; border-radius: var(--radius-s); font-size: 13px; }
.metadata-property:hover { background: var(--background-modifier-hover); }
.metadata-key { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.metadata-key svg.lucide { width: 14px; height: 14px; }
.metadata-value { color: var(--text-normal); word-break: break-word; }
.metadata-value .empty { color: var(--text-faint); }

/* markdown */
.markdown-rendered { line-height: 1.6; font-size: 15px; word-wrap: break-word; }
.markdown-rendered h1 { font-size: 1.6em; }
.markdown-rendered h2 { font-size: 1.35em; border-bottom: 1px solid var(--background-modifier-border); padding-bottom: 2px; }
.markdown-rendered h3 { font-size: 1.15em; }
.markdown-rendered h1, .markdown-rendered h2, .markdown-rendered h3, .markdown-rendered h4 { margin: 1.1em 0 .4em; line-height: 1.3; }
.markdown-rendered > :first-child { margin-top: 0; }
.markdown-rendered p { margin: .5em 0; }
.markdown-rendered ul, .markdown-rendered ol { padding-left: 1.6em; margin: .4em 0; }
.markdown-rendered li::marker { color: var(--text-faint); }
.markdown-rendered a { color: var(--link-color); text-decoration: underline; text-decoration-color: rgba(168, 139, 250, .4); }
.markdown-rendered a.internal-link { text-decoration: none; cursor: pointer; }
.markdown-rendered a.internal-link:hover { text-decoration: underline; }
.markdown-rendered a.internal-link.is-unresolved { opacity: var(--link-unresolved-opacity); text-decoration: underline dashed; }
.markdown-rendered a.tag {
  background: var(--tag-background); color: var(--tag-color); border-radius: 1em; padding: 1px 8px;
  text-decoration: none; font-size: .88em; cursor: pointer;
}
.markdown-rendered code { font-family: var(--font-monospace); background: var(--code-background); padding: 1px 5px; border-radius: var(--radius-s); font-size: .88em; }
.markdown-rendered pre { background: var(--code-background); padding: 10px 12px; border-radius: var(--radius-s); overflow-x: auto; }
.markdown-rendered pre code { padding: 0; background: none; }
.markdown-rendered blockquote { margin: .6em 0; padding: 2px 14px; border-left: 2px solid var(--blockquote-border); color: var(--text-muted); }
.markdown-rendered table { border-collapse: collapse; margin: .6em 0; }
.markdown-rendered th, .markdown-rendered td { border: 1px solid var(--background-modifier-border); padding: 4px 10px; }
.markdown-rendered th { background: var(--background-secondary); }
.markdown-rendered hr { border: 0; border-top: 1px solid var(--background-modifier-border); }
.markdown-rendered input[type="checkbox"] { margin-right: 6px; }
.callout { --callout-color: var(--callout-info); background: rgba(var(--callout-color), .1); border-left: 0 !important; border-radius: var(--radius-s); padding: 10px 14px !important; color: var(--text-normal) !important; }
.callout[data-callout="todo"] { --callout-color: var(--callout-todo); }
.callout[data-callout="warning"], .callout[data-callout="caution"] { --callout-color: var(--callout-warning); }
.callout[data-callout="tip"] { --callout-color: var(--callout-tip); }
.callout-title { font-weight: 600; color: rgb(var(--callout-color)); display: flex; align-items: center; gap: 6px; text-transform: capitalize; }

.note-section { margin-top: 24px; border-top: 1px solid var(--background-modifier-border); padding-top: 12px; }
.note-section-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.note-section-title svg.lucide { width: 14px; height: 14px; }
.note-section-title .count { margin-left: auto; color: var(--text-faint); font-weight: 400; }
.link-list { display: flex; flex-direction: column; }
.link-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--radius-s); color: var(--text-normal); cursor: pointer; font-size: 13px; }
.link-item:hover { background: var(--background-modifier-hover); }
.link-item .lp { color: var(--text-faint); font-size: 11px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.link-item.is-unresolved { color: var(--text-faint); }
.link-item svg.lucide { width: 14px; height: 14px; color: var(--text-faint); }
.link-list .empty { color: var(--text-faint); font-size: 12px; padding: 4px 6px; }

.note-editor { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 0; background: var(--background-primary); }
.note-editor label { display: flex; flex-direction: column; gap: 4px; color: var(--text-muted); font-size: 12px; }
.note-editor label.grow { flex: 1; min-height: 0; }
.note-editor textarea { flex: 1; resize: none; font-family: var(--font-monospace); font-size: 13px; line-height: 1.55; }
.editor-actions, .modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.btn { padding: 6px 14px; border-radius: var(--radius-s); border: 1px solid var(--background-modifier-border); background: var(--background-secondary-alt); cursor: pointer; }
.btn:hover { border-color: var(--background-modifier-border-hover); }
.btn-cta { background: var(--interactive-accent); border-color: var(--interactive-accent); color: var(--text-on-accent, #fff); }
.btn-cta:hover { background: var(--interactive-accent-hover); }
.btn-danger { color: #fb464c; }

/* ---------- modais / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; z-index: 50; }
.modal { width: 520px; max-width: 92vw; background: var(--background-primary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-wide { width: 620px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-subtitle { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-top: 6px; }
.modal label { display: flex; flex-direction: column; gap: 4px; color: var(--text-muted); font-size: 12px; }
.modal textarea { font-family: var(--font-monospace); resize: vertical; }
.vault-create { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--background-modifier-border); padding-top: 10px; }
.vault-list { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow-y: auto; }
.vault-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); border: 1px solid var(--background-modifier-border); }
.vault-row.is-current { border-color: var(--interactive-accent); }
.vault-row .vr-info { flex: 1; min-width: 0; }
.vault-row .vr-name { font-weight: 600; }
.vault-row .vr-desc { color: var(--text-faint); font-size: 12px; }
.vault-row .vr-badge { font-size: 11px; color: var(--text-accent); border: 1px solid var(--text-accent); border-radius: 10px; padding: 0 6px; margin-left: 6px; }

.toast-container { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--background-secondary-alt); color: var(--text-normal); padding: 10px 14px; border-radius: var(--radius-s); box-shadow: var(--shadow); font-size: 13px; max-width: 360px; }
.toast.error { border-left: 3px solid #fb464c; }
.graph-tooltip { position: absolute; pointer-events: none; }

/* ---- Login e gestao de usuarios ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--background-primary); }
.auth-card { width: 360px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); padding: 24px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; color: var(--text-normal); margin-bottom: 4px; }
.auth-submit { width: 100%; padding: 8px 14px; }
.auth-error { color: #fb464c; font-size: 13px; }
.auth-success { color: var(--text-accent); font-size: 13px; }
.users-page { max-width: 960px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: 100vh; color: var(--text-normal); }
.users-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.users-header h1 { flex: 1; font-size: 20px; margin: 0; }
.users-card { background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); padding: 16px; }
.users-card h2 { font-size: 15px; margin: 0 0 4px; }
.users-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; }
.users-form label { flex: 1 1 180px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.users-table-wrap { overflow-x: auto; margin-top: 10px; }
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th, .users-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--background-modifier-border); vertical-align: middle; overflow-wrap: break-word; }
/* colunas curtas (perfil, data, acoes) nunca quebram no meio da palavra; so nome e e-mail quebram */
.users-table th:nth-child(3), .users-table td:nth-child(3),
.users-table th:nth-child(4), .users-table td:nth-child(4),
.users-table td:last-child, .users-table .btn { white-space: nowrap; }
.users-table td:nth-child(2) { overflow-wrap: anywhere; }
.users-table th { color: var(--text-muted); font-weight: 600; }
.users-actions { text-align: right; }
.users-actions form { display: inline; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; color: var(--text-muted); font-size: 12px; }

/* ---- Login e usuarios: alvos de toque e campos legiveis ---- */
.auth-card label, .users-form label { gap: 6px; font-size: 13px; color: var(--text-muted); }
.auth-card input:not([type="checkbox"]), .users-form input { min-height: 42px; padding: 8px 12px; font-size: 14px; }
.auth-card .hint { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.auth-submit, .users-page .btn { min-height: 42px; font-size: 14px; text-decoration: none; }
.users-page a.btn { text-decoration: none; }
.users-header .btn { display: inline-flex; align-items: center; gap: 6px; }
.users-table .btn { min-height: 36px; padding: 6px 12px; }

/* tabela vira cartoes no celular (sem rolagem horizontal) */
@media (max-width: 575.98px) {
  .users-table-wrap { overflow: visible; }
  .users-table thead { display: none; }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
  .users-table tr { padding: 10px 0; border-bottom: 1px solid var(--background-modifier-border); }
  .users-table tr:last-child { border-bottom: 0; }
  .users-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .users-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; text-align: left; flex-shrink: 0; }
  .users-table td.ts-titulo { order: -1; font-weight: 600; font-size: 14px; }
  .users-table td.ts-titulo::before, .users-table td.users-actions::before { content: none; }
  .users-table td.users-actions { justify-content: flex-end; padding-top: 6px; }
  .users-table td.users-actions .btn, .users-table td.users-actions .hint { min-height: 44px; }
}

@media (max-width: 767.98px) {
  .auth-page { padding: 16px; }
  .auth-card { width: 100%; padding: 20px; gap: 14px; }
  .auth-card input:not([type="checkbox"]), .users-form input, .auth-submit, .users-page .btn, .users-table .btn { min-height: 44px; font-size: 16px; }
  .users-page { padding: 12px 16px 24px; }
  .users-header { gap: 8px; }
  .users-header h1 { order: -1; flex-basis: 100%; }
  .users-header .btn { flex: 1 1 auto; justify-content: center; }
  .users-form { flex-direction: column; align-items: stretch; gap: 14px; }
  .users-form label { flex: none; }
  .users-form .btn { width: 100%; }
  .users-card { padding: 14px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.users-card .hint { color: var(--text-muted); font-size: 12px; }
