/* Design system */
:root {
  --bg: #f6f8fd;
  --card: #ffffff;
  --border: #e3e8f0;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --text: #0f172a;
  --muted: #4b5563;
  --surface: #ffffff;
  --danger: #e11d48;
}

* { box-sizing: border-box; }

body {
  font-family: 'Manrope', Arial, sans-serif;
  background: radial-gradient(160% 160% at 20% 20%, #ffffff 0%, #f2f5ff 45%, #e8eefc 100%);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }


.app-shell { position: relative; overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; }
.floating-gradient {
  position: absolute;
  inset: -120px auto auto -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle at 30% 30%, rgba(79,70,229,0.25), rgba(79,70,229,0));
  filter: blur(28px);
  pointer-events: none;
}

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 22px 48px 22px; position: relative; flex: 1 0 auto; box-sizing: border-box; }

.top-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; justify-content: space-between; align-items: center; }
.top-actions > div { display: flex; align-items: center; gap: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.button.primary { background: linear-gradient(120deg, var(--primary), var(--primary-strong)); color: #fff; box-shadow: 0 12px 30px rgba(79,70,229,0.25); border-color: transparent; }
.button.ghost { background: rgba(255,255,255,0.75); color: var(--text); }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79,70,229,0.18); border-color: rgba(79,70,229,0.35); }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9)); box-shadow: 0 18px 50px rgba(15,23,42,0.08); }
.page-header h1 { margin: 4px 0 6px 0; font-size: 26px; letter-spacing: -0.01em; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--muted); }
.lede { margin: 0; color: var(--muted); max-width: 620px; line-height: 1.6; }

.chip { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: rgba(79,70,229,0.08); color: var(--text); font-weight: 600; transition: border-color 0.15s ease, transform 0.15s ease; }
.chip:hover { border-color: rgba(79,70,229,0.4); transform: translateY(-1px); }

.panel { margin-top: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 10px 18px; box-shadow: 0 12px 40px rgba(15,23,42,0.08); }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-title { margin: 0 0 4px 0; letter-spacing: -0.01em; }
.muted { color: var(--muted); margin: 0; }
.muted.small { font-size: 12px; }
.section-subtitle { margin: 12px 0 6px 0; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-weight: 600; color: var(--text); }
.input { width: 100%; padding: 12px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; background: #fff; color: var(--text); transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease; }
.input.input-lg { padding: 14px 14px; font-size: 16px; }
.input:focus { outline: none; border-color: rgba(79,70,229,0.55); box-shadow: 0 6px 20px rgba(79,70,229,0.08); transform: translateY(-1px); }

/* Ensure selects and other native controls follow the same visual language */
.form-field select.input, .form-field input[type="text"], .form-field input[type="datetime-local"], .form-field input[type="date"], .form-field input[type="time"], .form-field textarea.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form-field select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.form-field select.input:focus, .form-field input:focus, .form-field textarea:focus { outline: none; border-color: rgba(79,70,229,0.55); box-shadow: 0 6px 20px rgba(79,70,229,0.08); }

/* Perfis e Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-admin {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
}

.badge-gestor {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: white;
}

.badge-operador {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
}

.badge-visualizador {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
}

.badge-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

/* Grid de Perfis */
.perfil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.perfil-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.perfil-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,70,229,0.12);
  border-color: rgba(79,70,229,0.3);
}

.perfil-card.active {
  border-color: var(--primary);
  background: linear-gradient(145deg, rgba(79,70,229,0.03), rgba(79,70,229,0.01));
  box-shadow: 0 4px 16px rgba(79,70,229,0.15);
}

.perfil-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.perfil-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.perfil-body {
  flex: 1;
}

.perfil-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.perfil-info .label {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

.perfil-descricao {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0;
}

.perfil-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.perfil-meta small {
  color: var(--muted);
  font-size: 12px;
}

.perfil-footer {
  margin-top: 16px;
}

/* Formulário Inline */
.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.form-inline .form-group {
  flex: 1;
  min-width: 200px;
}

.form-inline .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
}

.form-inline .form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.form-inline .form-control:focus {
  outline: none;
  border-color: rgba(79,70,229,0.55);
  box-shadow: 0 4px 12px rgba(79,70,229,0.08);
}

/* Tabela de Permissões */
.permission-yes {
  color: #10b981;
  font-size: 18px;
  font-weight: bold;
}

.permission-no {
  color: #ef4444;
  font-size: 18px;
  font-weight: bold;
}

.perfil-hierarchy {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.perfil-hierarchy li {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(79,70,229,0.04);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  line-height: 1.6;
}

.perfil-hierarchy li strong {
  color: var(--primary);
}

/* Botões adicionais */
.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

/* Botões de Ação dos Perfis */
.btn-trabalhar,
.btn-atual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-trabalhar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(79,70,229,0.25);
}

.btn-trabalhar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-trabalhar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79,70,229,0.35);
}

.btn-trabalhar:hover::before {
  left: 100%;
}

.btn-trabalhar:active {
  transform: translateY(0);
}

.btn-atual {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  cursor: not-allowed;
  opacity: 0.9;
  box-shadow: 0 2px 8px rgba(16,185,129,0.2);
}

.btn-trabalhar .btn-icon,
.btn-atual .btn-icon {
  font-size: 18px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.btn-trabalhar:hover .btn-icon {
  transform: rotate(180deg);
}

.btn-atual .btn-icon {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}
.form-field textarea.input { min-height: 110px; resize: vertical; }
.form-field ::placeholder { color: var(--muted); }

/* Process search suggestions */
.process-search-wrapper { position: relative; }
.process-suggestions {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 10px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
  list-style: none;
  margin: 0; padding: 6px 6px; z-index: 9999; display: none; max-height: 260px; overflow: auto;
}
.process-suggestion { padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 14px; }
.process-suggestion:hover { background: rgba(79,70,229,0.06); color: var(--primary-strong); }
.process-search { padding-right: 14px; }
.field-help { margin: 0; font-size: 12px; color: var(--muted); }
.form-divider { height: 1px; background: var(--border); margin: 8px 0 4px 0; }

/* Form inline */
.form-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-inline .input { flex: 1 1 200px; min-width: 150px; }
.form-inline .button { min-width: 100px; width: 100px; padding: 10px 16px; text-align: center; justify-content: center; }

/* Toggle Switch */
.toggle-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; user-select: none; }
.toggle-switch input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s ease;
  border: 2px solid var(--border);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle-switch input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(24px);
}
.toggle-switch:hover .toggle-slider {
  border-color: var(--primary);
}

.user-block { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcff; margin-bottom: 12px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.checkbox-inline, .select-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.select-inline select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); }
.select-inline select:focus { outline: none; border-color: rgba(79,70,229,0.55); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.checkbox-inline input { accent-color: var(--primary); }

.form-actions { display: flex; gap: 10px; align-items: center; }
.form-actions .button.ghost { padding: 10px 14px; }

.process-list { list-style: none; padding: 0; margin: 10px 0 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.process-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px 14px 12px 14px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.12);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.process-card:hover { transform: translateY(-4px); border-color: rgba(79,70,229,0.4); box-shadow: 0 16px 40px rgba(15,23,42,0.16); }
.process-card strong { display: block; font-size: 17px; margin: 2px 0 8px 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.process-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.process-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.process-actions .action {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  background: transparent;
  border: none;
  color: var(--primary-strong);
  transition: color 0.12s ease, transform 0.12s ease, text-decoration 0.12s;
}
.process-actions .action:hover { text-decoration: underline; transform: translateY(-1px); color: var(--primary); }
.process-actions .action.danger { color: var(--danger); background: transparent; border: none; }
.process-actions .action.danger:hover { text-decoration: underline; }

/* Global action link styles - used by cards and plain tables */
.action {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  background: transparent;
  border: none;
  color: var(--primary-strong);
  text-decoration: none;
  transition: color 0.12s ease, transform 0.12s ease, text-decoration 0.12s;
}
.action:hover { text-decoration: underline; transform: translateY(-1px); color: var(--primary); }
.action.danger { color: var(--danger); background: transparent; border: none; }
.action.danger:hover { text-decoration: underline; }

.pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  background: #f5f7ff;
  color: var(--text);
  border: 1px solid var(--border);
}
.pill[class*="status-aguard"] { background: #fff7e6; color: #b45309; border-color: #f59e0b; }
.pill[class*="status-concl"] { background: #ecfdf3; color: #15803d; border-color: #4ade80; }
.pill[class*="status-andamento"],
.pill[class*="status-em-andamento"] { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }

.alert { padding: 12px 14px; border-radius: 10px; margin: 10px 0; border: 1px solid var(--border); background: #f8fafc; color: var(--text); }
.alert.success { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
.alert.info { background: #eef2ff; color: #312e81; border-color: #c7d2fe; }
/* Danger / Error tone */
.alert.error, .alert.danger {
  background: #fff1f2; /* light red */
  color: #881337; /* dark red text */
  border-color: #fecaca; /* pale red border */
}

.status-actions { margin: 10px 0 18px 0; }
.status-actions a { display:inline-block; margin-right:10px; padding:6px 10px; border-radius:10px; background: rgba(255,255,255,0.04); color: var(--text); font-weight:600; }

textarea { width:100%; min-height:90px; padding:10px; border:1px solid var(--border); border-radius:10px; background: #fff; color: var(--text); }
button { background: linear-gradient(120deg, var(--primary), var(--primary-strong)); color:#fff; padding:10px 14px; border:none; border-radius:10px; cursor:pointer; font-weight:600; box-shadow: 0 12px 24px rgba(79,70,229,0.25); }
button:hover { opacity:0.95; }

@media (max-width:780px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .panel-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .panel-header .filter-form { width: 100%; }
  .panel-header .header-actions { width: 100%; }
  .process-list { grid-template-columns: 1fr; }
}

/* Profile page grid */
.profile-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.profile-main { }
.profile-aside { }
.profile-panel { padding: 12px; }

@media (max-width:920px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-aside { order: 2; }
  .profile-main { order: 1; }
}

@media (max-width:480px) {
  /* Container e layout geral */
  .container { padding: 14px 10px 28px 10px; max-width: 100%; }
  
  /* Page header */
  .page-header { padding: 12px 8px; gap: 8px; border-radius: 8px; margin-top: 40px; }
  .page-header h1 { font-size: 18px; margin: 2px 0 4px 0; }
  .eyebrow { font-size: 11px; }
  .lede { font-size: 14px; line-height: 1.5; }
  
  /* Panel */
  .panel { margin-top: 40px; padding: 10px; border-radius: 10px; }
  .section-title { font-size: 17px; }
  .panel-header { gap: 8px; }
  .panel-header .filter-form { margin-top: 6px; width: 100%; }
  
  /* Top actions e botões */
  .top-actions { gap: 6px; padding: 10px 0; }
  .button { padding:10px; border-radius: 8px; font-size: 12px; white-space: nowrap; text-align: center; justify-content: center; }
  .button.primary { padding: 10px; font-size: 12px; }
  .top-actions > div { gap: 6px; }
  .left-actions .button { padding: 6px 8px; font-size: 12px; }
  .right-actions { gap: 6px; }
  .right-actions .muted.small { display: none; }
  .top-actions .button.ghost { padding: 6px 8px; font-size: 12px; }
  .header-actions .button { width: 100%; text-align: center; justify-content: center; }
  .form-inline .button { width: 100%; text-align: center; justify-content: center; }
  
  /* Formulários e inputs */
  .input { padding: 9px 7px; font-size: 13px; }
  .input.input-lg { padding: 10px 8px; font-size: 14px; }
  .form-field label { font-size: 13px; }
  .form-grid { gap: 10px; }
  
  /* Profile */
  .profile-grid { gap: 12px; }
  .profile-panel { padding: 10px; }
  
  /* Todo items (tarefas) */
  .todo-item { padding: 6px; gap: 6px; }
  .todo-checkbox { flex-shrink: 0; margin-right: 4px; }
  .todo-checkbox input[type="checkbox"] { width: 18px; height: 18px; }
  .todo-title { font-size: 13px; }
  .todo-desc { font-size: 11px; }
  .todo-meta { font-size: 10px; }
  .todo-actions { gap: 6px; flex-wrap: wrap; }
  .todo-actions a { font-size: 11px; padding: 4px 6px; }
  
  /* Process cards */
  .process-card { padding: 10px 8px 8px 8px; }
  .process-card strong { font-size: 14px; }
  
  /* Chips e pills */
  .chip { padding: 6px 10px; font-size: 11px; }
  .pill { padding: 5px 8px; font-size: 11px; }
  
  /* Mobile menu */
  .mobile-menu { width: 260px; max-width: 85%; }
  .mobile-menu-inner { padding: 12px 8px; gap: 8px; }
  .mobile-link { padding: 8px 8px; font-size: 13px; }
  
  /* Garantir que nada ultrapasse a largura da viewport */
  .panel, .page-header, .process-card, .todo-item, .todo-list { max-width: 100%; width: 100%; box-sizing: border-box; }
  .form-inline, .form-field, .input, .button, select, textarea { box-sizing: border-box; max-width: 100%; }
  .todo-body { min-width: 0; flex: 1 1 0; }
}

/* Regras de impressão */
@media print {
  body { background: #fff; color: #000; }
  .no-print { display: none !important; }
  .top-actions, .page-header, .floating-gradient { display: none !important; }
  .process-card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  header, .container { max-width: 100%; padding: 0; }
  /* Oculta o footer durante impressão */
  .footer { display: none !important; }
}

/* Movimentações (sem marcadores) */
.movimentacoes-list { list-style: none; padding: 0; margin: 0; }
.movimentacoes-list > li { margin-bottom: 10px; }

/* Histórico de andamentos (sem marcadores) */
.historico-list { list-style: none; padding: 0; margin: 0; }
.historico-list > li { margin-bottom: 12px; }

/* Users table styling */
.users-table { width: 100%; border-collapse: collapse; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.users-table thead th { background: rgba(255,255,255,0.05); padding: 12px 14px; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--border); text-align: left; }
.users-table tbody td { padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--border); color: var(--muted); }
.users-table tbody tr:hover { background: rgba(124,93,255,0.08); }

.users-table .action { display: inline-block; margin-right:8px; padding:6px 8px; border-radius:8px; background: transparent; color: var(--primary-strong); text-decoration:none; font-size:13px; border: none; transition: transform 0.12s ease, color 0.12s ease; }
.users-table .action.danger {
  /* Mesmo fundo das demais ações (transparente), apenas texto em vermelho */
  background: transparent;
  color: var(--danger);
  border-color: transparent;
  box-shadow: none;
}
.users-table .action:hover { text-decoration: underline; transform: translateY(-1px); color: var(--primary); }
.users-table .action.danger:hover {
  /* Mantém o texto vermelho no hover e evita efeito de sombra */
  color: var(--danger);
  text-decoration: underline;
  box-shadow: none;
}

@media (max-width:720px) {
  .form-inline { display: flex; flex-direction: column; gap: 12px; width: 100%; }
  .form-inline .input, .form-inline .button { width: 100%; box-sizing: border-box; flex: none; min-width: auto; }
  .users-table thead { display: none; }
  .users-table tbody td { display: block; width: 100%; padding: 8px 10px; font-size: 14px; }
  .users-table tbody tr { margin-bottom: 12px; display: block; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: var(--card); }
  .users-table tbody td:before { content: attr(data-label) ": "; font-weight:600; color: var(--text); display: inline-block; min-width: 90px; }
}

/* Ocultar botão de imprimir em dispositivos móveis */
@media (max-width:720px) {
  .no-print .button[onclick*="window.print"] { display: none !important; }
}

/* Espaçamento acima do botão Imprimir em desktop */
@media (min-width:721px) {
  .no-print .button[onclick*="window.print"] { margin-top: 16px; }
}

/* Lembretes table styling */
.lembretes-table { width: 100%; border-collapse: collapse; margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--card); }
.lembretes-table th, .lembretes-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.lembretes-table thead th { background: rgba(255,255,255,0.02); font-weight: 700; }
.lembretes-table tbody tr:nth-child(even) { background: #fbfdff; }
.lembretes-small { font-size: 0.92rem; color: var(--muted); }
.lembretes-table th:first-child { width: 60px; }
.lembretes-table th:nth-child(4) { width: 180px; }
.lembretes-table th:nth-child(5) { width: 80px; }
.lembretes-table th:nth-child(6) { width: 140px; }

/* Responsividade para tabela de lembretes: transforma em cartões em telas pequenas */
@media (max-width:720px) {
  .lembretes-table { border: none; }
  .lembretes-table thead { display: none; }
  .lembretes-table tbody td { display: block; width: 100%; padding: 8px 10px; border: none; }
  .lembretes-table tbody tr { margin-bottom: 12px; display: block; border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--card); }
  .lembretes-table tbody td:before { content: attr(data-label) ": "; font-weight:600; color: var(--text); display: inline-block; width: 120px; }
  .lembretes-table tbody td:last-child { padding-bottom: 12px; }
}

/* Tarefas table styling (lista pessoal) */
.list-table { width: 100%; border-collapse: collapse; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.list-table th, .list-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.list-table thead th { background: linear-gradient(180deg, rgba(79,70,229,0.03), rgba(255,255,255,0.02)); font-weight: 700; font-size: 14px; }
.list-table tbody tr:nth-child(even) { background: #fbfdff; }
.list-table tbody tr:hover { background: rgba(79,70,229,0.04); }
.list-table th:first-child { width: 60px; }
.list-table th:nth-child(3) { width: 160px; }
.list-table th:nth-child(4) { width: 90px; }
.list-table td.actions { white-space: nowrap; }
.list-table .status-pill { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 12px; letter-spacing: 0.01em; border: 1px solid var(--border); }
.list-table .concluida-true { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
.list-table .concluida-false { background: #fffaf0; color: #92400e; border-color: #fde68a; }
.list-table a.action { margin-right: 8px; font-size: 13px; }

@media (max-width:720px) {
  .list-table { border: none; }
  .list-table thead { display: none; }
  .list-table tbody td { display: block; width: 100%; padding: 10px 12px; border: none; }
  .list-table tbody tr { margin-bottom: 12px; display: block; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: var(--card); }
  .list-table tbody td:before { content: attr(data-label) ": "; font-weight:600; color: var(--text); display: inline-block; width: 110px; }
  .list-table tbody td.actions { padding-top: 8px; }
}

/* Todo list styling */
.todo-list { list-style: none; padding: 0; margin: 10px 0 0 0; display: flex; flex-direction: column; gap: 10px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  cursor: move;
}
.todo-item:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15,23,42,0.06); }
.todo-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  box-shadow: 0 8px 20px rgba(79,70,229,0.3);
}
.todo-item.drag-over {
  border-color: var(--primary);
  background: rgba(79,70,229,0.05);
  transform: translateY(-2px);
}
.todo-checkbox { flex: 0 0 auto; }
.todo-checkbox input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }
.todo-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.todo-title { font-weight: 700; font-size: 15px; color: var(--text); }
.todo-title.concluded { text-decoration: line-through; color: var(--muted); font-weight:600; }
.todo-desc { color: var(--muted); font-size: 13px; }

/* Markdown content styling */
.markdown-content { 
  color: var(--text); 
  font-size: 13px; 
  line-height: 1.7; 
  word-wrap: break-word;
}
.markdown-content p { 
  margin: 8px 0; 
  color: var(--text);
  line-height: 1.6;
}
.markdown-content h1 { 
  font-size: 18px; 
  font-weight: 700; 
  margin: 12px 0 8px 0; 
  color: var(--text); 
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
}
.markdown-content h2 { 
  font-size: 16px; 
  font-weight: 700; 
  margin: 10px 0 6px 0; 
  color: var(--text); 
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.markdown-content h3 { 
  font-size: 15px; 
  font-weight: 600; 
  margin: 8px 0 6px 0; 
  color: var(--text); 
}
.markdown-content strong { 
  font-weight: 700; 
  color: var(--text); 
}
.markdown-content em { 
  font-style: italic; 
  color: var(--text);
}
.markdown-content del { 
  text-decoration: line-through; 
  opacity: 0.6; 
  color: var(--muted);
}
.markdown-content code { 
  background: rgba(79,70,229,0.1); 
  padding: 3px 8px; 
  border-radius: 4px; 
  font-family: 'Courier New', 'Consolas', monospace; 
  font-size: 12px; 
  color: var(--primary-strong);
  border: 1px solid rgba(79,70,229,0.15);
}
.markdown-content a { 
  color: var(--primary); 
  text-decoration: none; 
  border-bottom: 1px solid var(--primary);
  transition: all 0.2s ease;
}
.markdown-content a:hover { 
  color: var(--primary-strong); 
  border-bottom-color: var(--primary-strong);
  background: rgba(79,70,229,0.05);
}
.markdown-content ul { 
  margin: 8px 0; 
  padding-left: 24px; 
  list-style: disc;
}
.markdown-content ul li { 
  margin: 0; 
  line-height: 1.3;
  color: var(--text);
}
.markdown-content ul li p {
  margin: 0;
  display: inline;
}
.markdown-content ol {
  margin: 8px 0;
  padding-left: 24px;
  list-style: decimal;
}
.markdown-content ol li {
  margin: 0;
  line-height: 1.3;
  color: var(--text);
}
.markdown-content ol li p {
  margin: 0;
  display: inline;
}
.markdown-content blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 4px solid var(--primary);
  background: rgba(79,70,229,0.04);
  color: var(--muted);
  font-style: italic;
  border-radius: 0 6px 6px 0;
}
.markdown-content pre {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}
.markdown-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--text);
  font-size: 13px;
}
.markdown-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 16px 0;
}
.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}
.markdown-content br { 
  display: block; 
  margin: 3px 0; 
  content: ""; 
}

.markdown-help { font-size: 11px; color: var(--muted); margin-top: 4px; padding: 8px; background: rgba(79,70,229,0.04); border-radius: 6px; border: 1px solid var(--border); }
.markdown-help strong { font-weight: 600; color: var(--text); }

/* EasyMDE Editor Customization */
.EasyMDEContainer { margin-top: 8px; }
.EasyMDEContainer .CodeMirror { 
  border: 1px solid var(--border); 
  border-radius: 10px; 
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 14px;
  min-height: 200px;
}
.EasyMDEContainer .CodeMirror:focus-within {
  border-color: rgba(79,70,229,0.55);
  box-shadow: 0 6px 20px rgba(79,70,229,0.08);
}
.EasyMDEContainer .editor-toolbar {
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: rgba(255,255,255,0.5);
}
.EasyMDEContainer .editor-toolbar button {
  color: var(--text) !important;
  border: none !important;
}
.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
  background: rgba(79,70,229,0.1) !important;
  border-color: transparent !important;
  color: var(--primary-strong) !important;
}
.EasyMDEContainer .editor-toolbar i.separator {
  border-left: 1px solid var(--border);
  border-right: none;
}
.EasyMDEContainer .editor-statusbar {
  color: var(--muted);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
}
.EasyMDEContainer .CodeMirror-cursor {
  border-left-color: var(--primary);
}
.editor-preview, .editor-preview-side {
  background: #fff;
  border: 1px solid var(--border);
  font-family: 'Manrope', Arial, sans-serif;
  padding: 12px;
}

.todo-meta { font-size: 12px; color: var(--muted); }
.todo-reorder { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
.reorder-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(79,70,229,0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--primary-strong);
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  transition: all 0.2s ease;
}
.reorder-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(1.1);
}
.todo-actions { flex: 0 0 auto; display:flex; gap:8px; align-items:center; }
.todo-actions a { font-size: 13px; }

@media (max-width:720px) {
  .todo-item { padding: 10px; flex-wrap: wrap; }
  .todo-checkbox { flex: 0 0 auto; }
  .todo-body { flex: 1 1 100%; gap: 6px; }
  .todo-reorder { flex-direction: row; order: 3; }
  .todo-actions { flex: 1 1 100%; margin-top: 8px; justify-content: flex-start; gap: 12px; order: 4; }
}


.footer {
  text-align: center;
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

/* Login / Auth specific styles */
.auth-panel { max-width: 520px; margin: 48px auto; }
.auth-header { display:flex; align-items:center; gap:14px; margin-bottom:8px; }
.auth-logo { width:52px; height:52px; border-radius:10px; background: linear-gradient(120deg, var(--primary), var(--primary-strong)); box-shadow: 0 8px 20px rgba(79,70,229,0.18); }
.auth-heading { margin:4px 0 0 0; font-size:20px; }
.auth-form { margin-top:14px; padding: 16px 0; }
.auth-form-actions { margin-top:6px; }
/* Entrar: aumentar largura do botão na tela de login */
.auth-form .auth-enter { display: block; width: 100%; padding: 14px 18px; text-align: center; box-sizing: border-box; }
@media (max-width:480px) {
  .auth-form .auth-enter { width: 100%; }
}

/* Footer visual e comportamento fixo ao final da página */
.footer {
  padding: 14px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: transparent;
  border-top: 1px solid rgba(0,0,0,0.04);
  margin-left: 260px;
  transition: margin-left 0.3s ease;
}

/* Footer sem margem quando não há sidebar (página de login) */
.app-shell:not(:has(.sidebar)) .footer {
  margin-left: 0;
}

@media (max-width:768px) {
  .footer {
    margin-left: 0;
  }
}

@media (max-width:720px) {
  .footer { padding: 12px 10px; font-size: 12px; }
}

/* Bloqueio de scroll de fundo quando menu móvel estiver aberto */
html.no-scroll, body.no-scroll { overflow: hidden; height: 100%; }

/* ============================================
   FILTROS DE TAREFAS
   ============================================ */
.tarefas-filter-form {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tarefas-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tarefas-filter-actions .button {
  white-space: nowrap;
  margin: 0;
}

/* Responsivo para tablets */
@media (max-width: 920px) {
  .tarefas-filter-form {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .tarefas-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Responsivo para mobile */
@media (max-width: 600px) {
  .tarefas-filter-form {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  
  .tarefas-filter-actions {
    grid-column: 1;
    width: 100%;
  }
  
  .tarefas-filter-actions .button {
    flex: 1;
    justify-content: center;
  }
}

/* ============================================
   SIDEBAR (MENU LATERAL)
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fd 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 2px 0 12px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(79,70,229,0.03);
}

.sidebar-logo {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
  padding: 0 18px 8px 18px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  font-weight: 500;
  font-size: 14px;
}

.nav-link:hover {
  background: rgba(79,70,229,0.08);
  border-left-color: rgba(79,70,229,0.3);
  color: var(--primary-strong);
}

.nav-link.active {
  background: rgba(79,70,229,0.12);
  border-left-color: var(--primary);
  color: var(--primary-strong);
  font-weight: 600;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: rgba(79,70,229,0.02);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.main-content .container {
  padding-top: 28px;
}

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 900;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
  transition: transform 0.2s ease;
}

.mobile-menu-btn:hover {
  transform: scale(1.05);
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Responsivo - Mobile */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  body.sidebar-open {
    overflow: hidden;
  }
  
  .main-content .container {
    padding-top: 80px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 280px;
  }
  
  .main-content .container {
    padding-top: 75px;
  }
}
/* Estilos das abas (tabs) */
.tabs-container {
  display: flex;
  margin-bottom: 16px;
  gap: 4px;
}

.tab-button {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  transition: all 0.3s;
  position: relative;
  bottom: -2px;
}

.tab-button:hover {
  color: var(--text);
  background-color: rgba(79, 70, 229, 0.05);
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-content {
  display: none;
  padding-top: 8px;
}

.tab-content.active {
  display: block;
}

/* Estilos do checklist de demandas */
.demanda-todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.demanda-todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s;
}

.demanda-todo-item:hover {
  background-color: rgba(79, 70, 229, 0.03);
}

.todo-checkbox-wrapper {
  display: flex;
  align-items: center;
}

.todo-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.todo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.todo-text {
  font-size: 15px;
  transition: all 0.2s;
  word-wrap: break-word;
}

.todo-concluido .todo-text {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.6;
}

.todo-meta {
  font-size: 12px;
  color: var(--muted);
}

.todo-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.todo-star {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #ccc;
  transition: all 0.2s;
  padding: 4px 8px;
}

.todo-star:hover {
  color: #ffd700;
  transform: scale(1.2);
}

.todo-star.starred {
  color: #ffd700;
}

.todo-delete {
  color: var(--danger);
  font-size: 18px;
  text-decoration: none;
  padding: 4px 8px;
  transition: all 0.2s;
  font-weight: bold;
}

.todo-delete:hover {
  transform: scale(1.2);
  color: #cc0000;
}
