/* OficioWeb — Dark Institucional
   Direção Estética: SaaS Dark Mode de Alta Densidade
   Camadas de profundidade real (nunca #000 puro)
   Bordas translúcidas, sombras coloridas, micro-interações GPU
   Tipografia: JetBrains Mono (dados) + Inter (interface)
   Ícones: Tabler (webfont local)
   tabular-nums obrigatório em números */

/* ==== FONTES ==== */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "tabler-icons";
  src: url("/static/fonts/tabler-icons.woff2") format("woff2"),
       url("/static/fonts/tabler-icons.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

:root {
  /* Tokens — Escuro sóbrio institucional (âmbar-ouro, zero neon) */
  --bg: #0e1116;
  --bg-card: #161b22;
  --bg-elevated: #1a2029;
  --bg-hover: #1f2630;
  --border: #2a313c;
  --border-strong: #3a424e;
  --text: #e6edf3;
  --text-dim: #8b98a9;
  --text-faint: #5d6875;
  --primary: #2F6B3A;
  --primary-dim: rgba(47, 107, 58, 0.16);
  --accent: #58a6ff;
  --accent-dim: rgba(88, 166, 255, 0.12);

  /* Status — semânticos, dessaturados */
  --ok: #3fb950;
  --ok-dim: rgba(63, 185, 80, 0.12);
  --warn: #d29922;
  --warn-dim: rgba(210, 153, 34, 0.12);
  --err: #f85149;
  --err-dim: rgba(248, 81, 73, 0.12);
  --info: #58a6ff;
  --info-dim: rgba(88, 166, 255, 0.12);

  /* Sombra sutil OU borda — nunca os dois carregados */
  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.4);

  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --font-sans: "Manrope", "Segoe UI", system-ui, sans-serif;

  --radius-s: 8px;
  --radius-l: 14px;
  --transition: 0.15s ease;
}

/* ==== TABLER ICONS ==== */
.ti {
  font-family: "tabler-icons" !important;
  font-style: normal;
  font-weight: normal !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 1.2em;
  vertical-align: -0.15em;
}

.ti-dashboard::before { content: "\ea47"; }
.ti-file-plus::before { content: "\eb06"; }
.ti-list::before { content: "\eb85"; }
.ti-settings::before { content: "\ebd2"; }
.ti-mail::before { content: "\ea5a"; }
.ti-mail-opened::before { content: "\ec2e"; }
.ti-download::before { content: "\ec19"; }
.ti-upload::before { content: "\ec1a"; }
.ti-send::before { content: "\ebab"; }
.ti-paperclip::before { content: "\eb24"; }
.ti-alert-circle::before { content: "\e960"; }
.ti-check::before { content: "\eb09"; }
.ti-x::before { content: "\eb55"; }
.ti-clock::before { content: "\eb15"; }
.ti-trash::before { content: "\eb48"; }
.ti-edit::before { content: "\ec0a"; }
.ti-user::before { content: "\eb4d"; }
.ti-users::before { content: "\eb4e"; }
.ti-shield::before { content: "\eb11"; }
.ti-world::before { content: "\eb56"; }
.ti-server::before { content: "\ea58"; }
.ti-database::before { content: "\ea86"; }
.ti-logout::before { content: "\ea7a"; }
.ti-plus::before { content: "\eb0b"; }
.ti-chevron-right::before { content: "\ea02"; }
.ti-arrow-left::before { content: "\ea0d"; }
.ti-refresh::before { content: "\eb13"; }
.ti-search::before { content: "\eb12"; }
.ti-eye::before { content: "\e972"; }
.ti-file-text::before { content: "\eb08"; }
.ti-copy::before { content: "\e95c"; }
.ti-lock::before { content: "\ea6e"; }
.ti-key::before { content: "\ea66"; }
.ti-palette::before { content: "\eb07"; }
.ti-signature::before { content: "\eb45"; }
.ti-circle-check::before { content: "\ea00"; }
.ti-circle-x::before { content: "\ea11"; }
.ti-circle-alert::before { content: "\ea08"; }
.ti-volume-off::before { content: "\eb5c"; }
.ti-inbox::before { content: "\ea5c"; }
.ti-chart-bar::before { content: "\ea59"; }
.ti-calendar::before { content: "\e987"; }
.ti-building::before { content: "\ea1f"; }
.ti-briefcase::before { content: "\ea22"; }
.ti-folder-open::before { content: "\ea30"; }
.ti-link::before { content: "\ea68"; }
.ti-shield-lock::before { content: "\eb11"; }
.ti-lock-open::before { content: "\ea6f"; }

html { font-size: 1rem; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 17.143rem;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.143rem 0;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar .logo {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar .logo h1 {
  font-size: 0.9286rem;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar .logo .sub {
  font-size: 0.7143rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.sidebar nav { flex: 1; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.8571rem;
  padding: 0.7857rem 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9286rem;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  margin: 0 8px;
  border-radius: 0.429rem;
  border-left-width: 2px;
}

.sidebar nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
  transform: translateX(2px);
}

.sidebar nav a.active {
  color: var(--accent);
  background: var(--info-dim);
  border-left-color: var(--accent);
}

.sidebar nav a .ti { font-size: 1.2857rem; flex-shrink: 0; }

.sidebar nav a .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7143rem;
  background: var(--bg);
  padding: 0.0714rem 7px;
  border-radius: 0.714rem;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.sidebar .user {
  padding: 1.1429rem 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8571rem;
}

.sidebar .user .name { color: var(--text); font-weight: 600; font-family: var(--font-mono); font-size: 0.8571rem; }
.sidebar .user .role {
  color: var(--text-dim);
  font-size: 0.7143rem;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.main {
  flex: 1;
  padding: 2rem 2.571rem;
  max-width: 85.714rem;
  margin-left: 17.143rem;
}

/* Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.page-header .meta {
  font-size: 0.8571rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* Cards — elevação com sombra colorida, não borda grossa */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-s);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-card);
  border-color: var(--border-strong);
}

.card .card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: none;
  color: var(--text-dim);
  letter-spacing: 0;
  margin-bottom: 1.1429rem;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 0.5714rem;
}

.card .card-title .ti { color: var(--primary); font-size: 1.1429rem; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1429rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1429rem; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.8571rem; }

/* Stat cards — tabular-nums obrigatório */
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 1.2857rem 16px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-s);
}

.stat:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.stat .ti {
  font-size: 1.5714rem;
  margin-bottom: 6px;
  display: block;
}

.stat .number {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat .label {
  font-size: 0.7143rem;
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 4px;
}

.stat .number.accent { color: var(--accent); }
.stat .number.green { color: var(--ok); }
.stat .number.red { color: var(--err); }
.stat .number.yellow { color: var(--warn); }
.stat .number.purple { color: var(--info); }

/* Tabela — tabular-nums */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9286rem;
}

table th {
  text-align: left;
  padding: 0.7143rem 12px;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 0.7143rem;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
}

table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

table tr:hover td {
  background: var(--bg-hover);
}

table tr:last-child td { border-bottom: none; }

table .mono { font-family: var(--font-mono); font-size: 0.8571rem; }

/* Status badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3571rem;
  padding: 0.2143rem 10px;
  border-radius: 0.429rem;
  font-size: 0.7857rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

.badge-status .ti { font-size: 1rem; }

.badge-aguardando { background: var(--warn-dim); color: var(--warn); border: 1px solid var(--warn); }
.badge-concluida { background: var(--ok-dim); color: var(--ok); border: 1px solid var(--ok); }
.badge-recusada { background: var(--err-dim); color: var(--err); border: 1px solid var(--err); }
.badge-sem-resposta { background: rgba(113, 113, 122, 0.15); color: var(--text-dim); border: 1px solid var(--text-faint); }
.badge-recebido { background: var(--info-dim); color: var(--info); border: 1px solid var(--info); }
.badge-confirmado { background: var(--info-dim); color: var(--accent); border: 1px solid var(--accent); }

/* Botões — micro-interação GPU */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4286rem;
  padding: 0.5714rem 16px;
  border-radius: 0.429rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9286rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.btn:active { transform: scale(0.98); }

.btn .ti { font-size: 1.1429rem; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #09090b;
  font-weight: 600;
}
.btn.primary:hover {
  background: #7cbaff;
  border-color: #7cbaff;
  color: #09090b;
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.25);
}

.btn.danger {
  background: transparent;
  border-color: var(--err);
  color: var(--err);
}
.btn.danger:hover {
  background: var(--err);
  border-color: var(--err);
  color: #09090b;
  box-shadow: 0 4px 16px rgba(248, 113, 113, 0.25);
}

.btn.sm { padding: 0.3571rem 12px; font-size: 0.8571rem; }

/* Form */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.7857rem;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-sans);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7143rem 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.429rem;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--info-dim);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-faint); }

.form-group .help {
  font-size: 0.7857rem;
  color: var(--text-faint);
  margin-top: 5px;
}

.form-group .help.mono { font-family: var(--font-mono); }

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

/* Wizard — stagger de entrada */
.wizard-progress {
  display: flex;
  gap: 0.2857rem;
  margin-bottom: 28px;
}

.wizard-progress .step {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 0.143rem;
  transition: background var(--transition);
}

.wizard-progress .step.done { background: var(--ok); }
.wizard-progress .step.current { background: var(--accent); }

/* Flash — com ícone */
.flash {
  padding: 0.8571rem 16px;
  border-radius: var(--radius-s);
  margin-bottom: 16px;
  font-size: 0.9286rem;
  display: flex;
  align-items: center;
  gap: 0.7143rem;
}

.flash.success { background: var(--ok-dim); color: var(--ok); border: 1px solid var(--ok); }
.flash.error { background: var(--err-dim); color: var(--err); border: 1px solid var(--err); }
.flash.info { background: var(--info-dim); color: var(--accent); border: 1px solid var(--accent); }

/* Login — profundidade de camadas */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-box {
  width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 36px;
  box-shadow: var(--shadow-float);
}

.login-box .logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-box .logo .ti {
  font-size: 3.1429rem;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.login-box .logo h1 {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.2857rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.login-box .logo .sub {
  color: var(--text-faint);
  font-size: 0.7857rem;
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* Webmail */
.mail-container {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  min-height: 520px;
  box-shadow: var(--shadow-card);
}

.mail-sidebar {
  width: 20rem;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.143rem;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 45.714rem;
}

.mail-sidebar .mail-item {
  padding: 0.8571rem 14px;
  border-radius: var(--radius-s);
  margin-bottom: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.mail-sidebar .mail-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
  transform: translateX(2px);
}

.mail-sidebar .mail-item.selected {
  background: var(--info-dim);
  border-color: var(--accent);
}

.mail-sidebar .mail-item .from { font-weight: 600; font-size: 0.8571rem; color: var(--text); }
.mail-sidebar .mail-item .subject { font-size: 0.7857rem; color: var(--text-dim); margin-top: 2px; }
.mail-sidebar .mail-item .date { font-size: 0.7143rem; color: var(--text-faint); font-family: var(--font-mono); margin-top: 4px; }

.mail-content { flex: 1; padding: 24px; background: var(--bg); }

.mail-content .mail-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.mail-content .mail-header .subject {
  font-size: 1.1429rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.mail-content .mail-header .meta {
  font-size: 0.8571rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mail-content .mail-header .meta span { display: inline-block; margin-right: 16px; }

.reply-box { margin-top: 20px; }

.reply-box textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  padding: 14px;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.reply-box textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--info-dim);
}

.attachments { display: flex; gap: 0.5714rem; flex-wrap: wrap; margin-top: 14px; }

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5714rem;
  padding: 0.4286rem 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  font-size: 0.8571rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  transition: all var(--transition);
}

.attachment-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--info-dim);
}

.attachment-chip .ti { font-size: 1.1429rem; color: var(--accent); }

.reply-thread { margin-top: 20px; }

.reply-thread .reply-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 14px;
  margin-bottom: 10px;
  font-size: 0.9286rem;
  transition: border-color var(--transition);
}

.reply-thread .reply-item:hover { border-color: var(--border-strong); }

.reply-thread .reply-item .reply-from {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.8571rem;
  display: flex;
  align-items: center;
  gap: 0.4286rem;
}

.reply-thread .reply-item .reply-date {
  font-size: 0.7857rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.reply-thread .reply-item .reply-body {
  margin-top: 8px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* Details expandable */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 14px;
  margin-top: 14px;
  background: var(--bg-card);
}

details summary {
  font-weight: 600;
  font-size: 0.9286rem;
  cursor: pointer;
  color: var(--accent);
  transition: color var(--transition);
}

details summary:hover { color: var(--text); }

/* Animação de entrada — stagger sutil */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .stat {
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stat:nth-child(2) { animation-delay: 0.04s; }
.stat:nth-child(3) { animation-delay: 0.08s; }
.stat:nth-child(4) { animation-delay: 0.12s; }
.stat:nth-child(5) { animation-delay: 0.16s; }
.stat:nth-child(6) { animation-delay: 0.20s; }

/* Scroll */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 0.214rem; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Focus visible — a11y */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsivo — mobile-first real */
@media (max-width: 768px) {
  .sidebar { width: 52px; }
  .sidebar .logo h1, .sidebar .logo .sub,
  .sidebar nav a span, .sidebar .user { display: none; }
  .sidebar nav a { justify-content: center; padding: 0.9286rem 16px; }
  .main { margin-left: 52px; padding: 16px; }
  .grid-2, .grid-3, .grid-6 { grid-template-columns: 1fr 1fr; }
  .mail-container { flex-direction: column; }
  .mail-sidebar { width: 100%; max-height: 200px; }
}

@media (max-width: 375px) {
  .grid-2, .grid-3, .grid-6 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
}

/* ============================================================

/* ============================================================
   POLISH — Escuro sóbrio institucional
   Regras: borda OU sombra (nunca os dois), zero glow/aurora,
   transições 150ms, 1 animação máx por página
   ============================================================ */

::selection { background: rgba(47, 107, 58, 0.35); color: var(--text); }

/* Sidebar — sólida, borda como separador */
.sidebar {
  background: var(--bg-card);
}

.sidebar nav a.active {
  color: var(--primary);
  background: var(--primary-dim);
  border-left-color: var(--primary);
}

.sidebar nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
  transform: none;
}

.sidebar nav a .badge {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-dim);
}

/* Page header — sem sticky glass, sem barra glow */
.page-header h2 {
  padding-left: 0;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 700;
}

.page-header .meta { color: var(--text-dim); }

/* Cards — borda, sem sombra */
.card,
.stat,
.mail-container,
details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: none;
}

.card:hover { border-color: var(--border-strong); }

.card .card-title {
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.8rem;
}

.card .card-title .ti { color: var(--primary); }

/* Stat — número protagonista, sem glow, sem barra no topo */
.stat { padding: 1.2rem 1rem; }
.stat::before { display: none; }
.stat:hover { border-color: var(--border-strong); transform: none; box-shadow: none; }

.stat .number {
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: none;
  filter: none;
}

.stat .number.green   { color: var(--ok); }
.stat .number.yellow  { color: var(--warn); }
.stat .number.red     { color: var(--err); }
.stat .number.purple  { color: var(--info); }
.stat .number.accent  { color: var(--primary); }

/* Botões — primário âmbar institucional */
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #0e1116;
  font-weight: 600;
}
.btn.primary:hover {
  background: #3d8449;
  border-color: #3d8449;
  color: #0e1116;
  box-shadow: none;
  transform: none;
}
.btn.primary::after { display: none; }

.btn.danger {
  background: transparent;
  border-color: var(--err);
  color: var(--err);
}
.btn.danger:hover {
  background: var(--err);
  border-color: var(--err);
  color: #0e1116;
  box-shadow: none;
}

.btn:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.btn.primary:hover { background: #3d8449; border-color: #3d8449; }

/* Inputs — foco âmbar */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.reply-box textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Tabela — hover discreto */
table th { border-bottom: 1px solid var(--border-strong); color: var(--text-dim); }
tbody tr { animation: none; }
tbody tr:hover td { background: var(--bg-hover); }

/* Badges — borda semântica, sem glow */
.badge-aguardando  { background: var(--warn-dim); color: var(--warn); border: 1px solid var(--warn); box-shadow: none; }
.badge-confirmado  { background: var(--info-dim); color: var(--info); border: 1px solid var(--info); box-shadow: none; }
.badge-concluida   { background: var(--ok-dim); color: var(--ok); border: 1px solid var(--ok); box-shadow: none; }
.badge-recusada    { background: var(--err-dim); color: var(--err); border: 1px solid var(--err); box-shadow: none; }
.badge-recebido    { background: var(--info-dim); color: var(--info); border: 1px solid var(--info); box-shadow: none; }
.badge-sem-resposta { background: var(--bg-hover); color: var(--text-dim); border: 1px solid var(--border-strong); box-shadow: none; }

/* Login — sóbrio, borda e sombra flutuante */
.login-page {
  background: var(--bg);
  animation: none;
}
.login-box {
  border-color: var(--border);
  box-shadow: var(--shadow-float);
}
.login-box .logo .ti { color: var(--primary); text-shadow: none; }
.login-box .logo h1 { color: var(--text); text-shadow: none; letter-spacing: 0.04em; }

/* Flash */
.flash.success { background: var(--ok-dim); color: var(--ok); border: 1px solid var(--ok); box-shadow: none; }
.flash.error   { background: var(--err-dim); color: var(--err); border: 1px solid var(--err); box-shadow: none; }
.flash.info    { background: var(--info-dim); color: var(--info); border: 1px solid var(--info); box-shadow: none; }

/* Wizard — steps discretos */
.wizard-progress .step.current { background: var(--primary); box-shadow: none; }
.wizard-progress .step.done    { background: var(--ok); box-shadow: none; }

/* Mail */
.mail-sidebar .mail-item.selected {
  background: var(--primary-dim);
  border-color: var(--primary);
  box-shadow: none;
}
.mail-sidebar .mail-item:hover { transform: none; }

/* Uma única animação de entrada (a página inteira) */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.main { animation: fadeIn 0.2s ease both; }

/* Elemento memorável: número do ofício âncora */
.oficio-anchor {
  font: 700 clamp(2.5rem, 6vw + 1rem, 4rem)/1.05 var(--font-mono);
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}
.oficio-anchor .label {
  display: block;
  font: 600 0.8rem/1.4 var(--font-sans);
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

/* Estado vazio */
.empty {
  text-align: center;
  padding: var(--space-8, 4rem) 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-l);
}
.empty p { color: var(--text-dim); margin: 0.5rem 0 1.2rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Faixa de status — dashboard (substitui fileira de stat cards) */
.status-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.9rem 0.5rem;
  background: var(--bg-card);
  text-decoration: none;
  transition: background var(--transition);
}

.strip-item:hover { background: var(--bg-hover); }

.strip-item .n {
  font: 700 1.4rem/1.1 var(--font-mono);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.strip-item .n.warn { color: var(--warn); }
.strip-item .n.info { color: var(--info); }
.strip-item .n.ok   { color: var(--ok); }
.strip-item .n.err  { color: var(--err); }
.strip-item .n.dim  { color: var(--text-dim); }

.strip-item .l {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.strip-item .l .ti { font-size: 0.85rem; }

@media (max-width: 768px) {
  .status-strip { grid-template-columns: repeat(3, 1fr); }
}

.ti-point::before { content: "\eb0d"; }
/* Submenu de credenciais por orgão */
.cred-group { position: relative; display: inline-block; }

.cred-group summary { list-style: none; }
.cred-group summary::-webkit-details-marker { display: none; }

.cred-submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  min-width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-float);
  padding: 4px;
}

.submenu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}

.submenu-item:hover { background: var(--bg-hover); }
.submenu-item.active { background: var(--primary-dim); }

.submenu-item strong { font: 600 0.85rem var(--font-sans); color: var(--primary); }
.submenu-item span { font: 400 0.72rem var(--font-mono); color: var(--text-dim); }

/* Submenu da Administração (sidebar) */
.admin-subnav summary {
  list-style: none;
  cursor: pointer;
}
.admin-subnav summary::-webkit-details-marker { display: none; }

.admin-subnav summary, .admin-submenu a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1.25rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  margin: 0 0.5rem;
  border-radius: 6px;
  transition: all var(--transition);
}
.admin-subnav summary:hover, .admin-submenu a:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.admin-subnav summary.active {
  color: var(--primary);
  background: var(--primary-dim);
}
.admin-subnav summary.active span { color: var(--primary); }
.admin-submenu a.active {
  color: var(--primary);
  background: var(--primary-dim);
}
/* border-left de seleção igual aos links principais */
.admin-subnav summary.active,
.admin-submenu a.active {
  border-left: 2px solid var(--primary);
}
.admin-submenu a .ti { font-size: 0.95rem; }
.admin-submenu {
  padding-bottom: 0.3rem;
}
.admin-submenu a {
  padding-left: 2.4rem;
  font-size: 0.78rem;
}
