
/* ==========================================================================
   Design Tokens — alinhados ao portal (portal.css)
   ========================================================================== */
:root {
  --pm-blue-900: #0a1e4a;
  --pm-blue-800: #0d2860;
  --pm-blue-700: #1a3a7a;
  --pm-blue-600: #1e4694;
  --pm-blue-500: #2557b4;
  --pm-blue-400: #3b72d4;
  --pm-blue-100: #dce8ff;
  --pm-blue-50: #f0f5ff;
  --pm-blue-200: #bfdbfe;
  --pm-surface: #ffffff;
  --pm-surface-muted: #f4f6fb;
  --pm-green-700: #1b5e20;
  --pm-green-600: #2e7d32;
  --pm-green-500: #388e3c;
  --pm-green-100: #c8e6c9;
  --pm-green: #2e7d32;
  --pm-gold-600: #e65100;
  --pm-gold-500: #f59e0b;
  --pm-gold-100: #fef3c7;
  --pm-red-600: #c62828;
  --pm-red-500: #e53935;
  --pm-red-100: #ffcdd2;
  --pm-gray-900: #111827;
  --pm-gray-800: #1f2937;
  --pm-gray-700: #374151;
  --pm-gray-600: #4b5563;
  --pm-gray-500: #6b7280;
  --pm-gray-400: #9ca3af;
  --pm-gray-300: #d1d5db;
  --pm-gray-200: #e5e7eb;
  --pm-gray-100: #f3f4f6;
  --pm-gray-50: #f9fafb;
  --pm-white: #ffffff;
  --pm-shadow-sm: 0 1px 2px rgba(10, 30, 74, 0.05), 0 2px 10px rgba(10, 30, 74, 0.06);
  --pm-shadow-md: 0 4px 8px rgba(10, 30, 74, 0.06), 0 12px 28px rgba(10, 30, 74, 0.08);
  --pm-shadow-lg: 0 8px 16px rgba(10, 30, 74, 0.07), 0 20px 48px rgba(10, 30, 74, 0.1);
  --pm-font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pm-font-heading: 'Outfit', 'Source Sans 3', system-ui, sans-serif;
  --pm-gap-xs: .5rem;
  --pm-gap-sm: .75rem;
  --pm-gap-md: 1rem;
  --pm-gap-lg: 1.5rem;
  --pm-gap-xl: 2rem;
  --pm-radius-sm: .375rem;
  --pm-radius-md: .5rem;
  --pm-radius-lg: .75rem;
  --pm-radius-xl: 1rem;

  /* Aliases legados */
  --primary: var(--pm-blue-900);
  --primary-light: var(--pm-blue-700);
  --accent: var(--pm-blue-500);
  --accent-light: var(--pm-blue-400);
  --bg-main: var(--pm-surface-muted);
  --card-bg: var(--pm-surface);
  --text-main: var(--pm-gray-900);
  --text-light: var(--pm-gray-500);
  --border: var(--pm-gray-200);
  --green: var(--pm-green-500);
  --red: var(--pm-red-500);
  --blue: var(--pm-blue-500);
  --shadow: var(--pm-shadow-md);
  --shadow-lg: var(--pm-shadow-lg);
  --radius: var(--pm-radius-xl);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 8% -5%, rgba(79, 70, 229, 0.08), transparent 36%),
    radial-gradient(circle at 90% -15%, rgba(59, 130, 246, 0.08), transparent 34%),
    var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}
/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: linear-gradient(180deg, #060a1b 0%, #0b1330 42%, #0a1228 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width 0.28s cubic-bezier(0.4,0,0.2,1), box-shadow 0.28s;
  box-shadow: 6px 0 38px rgba(2, 6, 23, 0.35);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.sidebar.collapsed { width: 72px; }

.sidebar-logo {
  padding: 1.5rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 76px;
  flex-shrink: 0;
}
.sidebar-logo-mark {
  width: 38px; height: 38px;
  min-width: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  flex-shrink: 0;
}
.sidebar-logo-mark i, .sidebar-logo-mark svg, .sidebar-logo-mark .lucide { width: 20px; height: 20px; }
.sidebar-logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s, width 0.2s;
}
.sidebar-logo-text small {
  font-size: 0.68rem;
  color: #64748b;
  display: block;
  font-weight: 400;
}
.sidebar.collapsed .sidebar-logo {
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem 0 0.65rem;
  min-height: auto;
  justify-content: center;
}
.sidebar.collapsed .sidebar-logo-text {
  display: none;
}
.sidebar.collapsed .sidebar-toggle-btn {
  display: flex;
  margin-left: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.sidebar-toggle-btn {
  margin-left: auto;
  min-width: 28px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sidebar.collapsed .sidebar-toggle-btn { margin-left: 0; }

nav {
  padding: 1.2rem 0.6rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.nav-section {
  padding: 0.75rem 0.85rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}
.sidebar.collapsed .nav-section {
  display: none;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: #a6b5cf;
  cursor: pointer;
  border-radius: 12px;
  margin-bottom: 0.25rem;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.nav-item i, .nav-item svg, .nav-item .lucide { width: 18px; height: 18px; color: #94a3b8; flex-shrink: 0; transition: color 0.18s; }
.nav-item span { transition: opacity 0.2s; }
.sidebar.collapsed nav {
  padding: 0.35rem 0.25rem 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar.collapsed nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item {
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 auto 0.35rem;
  padding: 0;
  justify-content: center;
  align-items: center;
  gap: 0;
  border-left: none !important;
  border-radius: 12px;
}
.sidebar.collapsed .nav-item.active {
  border-left: none !important;
  background: rgba(59, 114, 212, 0.28) !important;
  box-shadow: inset 0 0 0 2px rgba(147, 197, 253, 0.45) !important;
}
.sidebar.collapsed .nav-item--featured {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 auto 0.5rem !important;
  padding: 0 !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  box-shadow: none !important;
  color: #fde68a !important;
}
.nav-item:hover {
  background: rgba(124, 130, 255, 0.16);
  color: #fff;
}
.nav-item:hover i, .nav-item:hover svg, .nav-item:hover .lucide { color: var(--accent-light); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(79, 70, 229, 0.15));
  color: #fff;
  border-left: 3px solid #9ea4ff;
  box-shadow: inset 0 0 0 1px rgba(124, 130, 255, 0.35);
}
.nav-item.active i, .nav-item.active svg, .nav-item.active .lucide { color: var(--accent-light); }

/* Tooltip when collapsed */
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  background: #1e293b;
  color: #f8fafc;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  z-index: 999;
  border: 1px solid rgba(255,255,255,0.08);
}

.main {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.28s cubic-bezier(0.4,0,0.2,1);
}
body.sidebar-collapsed .main { margin-left: 72px; }

.topbar {
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid #d7e0ec;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 #d8e0eb, 0 14px 30px -24px rgba(15, 23, 42, 0.45);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1rem;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-toggle-btn {
  width: 36px; height: 36px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.topbar-toggle-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.topbar h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.topbar-route {
  font-size: 0.74rem;
  color: #8a98ab;
  letter-spacing: 0.03em;
  font-weight: 600;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.875rem;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.3rem 0.9rem 0.3rem 0.4rem;
  box-shadow: 0 7px 18px -12px rgba(15, 23, 42, 0.32);
}
.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}
.user-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.85rem;
}
.user-role {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent);
  border-radius: 99px;
  padding: 0.15rem 0.5rem;
}

.content {
  padding: 2.2rem;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}
.page { display: none; opacity: 1; visibility: visible; }
.page.active {
  display: block;
  opacity: 1 !important;
  visibility: visible !important;
  animation: pageIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}
.section-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.85rem;
  box-shadow: var(--shadow);
  border: 1px solid #dbe4f0;
  margin-bottom: 2rem;
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 11px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 10px 18px -14px rgba(15, 23, 42, 0.5);
  border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3); }
.btn-secondary { background: #f8fafd; color: var(--text-main); border: 1px solid #d7e0ec; }
.btn-secondary:hover { background: #ecf1f8; border-color: #cdd8e7; }
.btn-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); }
.btn-green:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3); }
.btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #fff; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3); }
.btn-gold { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 8px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.2rem;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.65rem 1.85rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent);
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.green::before { background: linear-gradient(90deg, var(--green), #34d399); }
.stat-card.gold::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.red::before    { background: linear-gradient(90deg, var(--red), #f87171); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-num {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-card.green .stat-num { color: var(--green); }
.stat-card.gold  .stat-num { color: #d97706; }
.stat-card.red   .stat-num { color: var(--red); }
.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 600;
  margin-top: 0.5rem;
  letter-spacing: 0.01em;
}
.table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #dbe4f0;
  overflow-x: auto;
  margin-bottom: 2rem;
}
.table-header {
  padding: 1.5rem 1.85rem;
  border-bottom: 1px solid var(--border);
  background: #fdfdfe;
}
.table-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
}
table { width: 100%; border-collapse: collapse; }
th {
  padding: 1rem 1.65rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  background: linear-gradient(180deg, #f8fbff 0%, #f5f8fd 100%);
  border-bottom: 1px solid #dbe4f0;
}
td {
  padding: 1.15rem 1.65rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #e4ebf4;
  color: var(--text-main);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s;
}
td:last-child, th:last-child {
  text-align: right;
  width: 1%;
  white-space: nowrap;
  overflow: visible;
  max-width: none;
}
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #fcfdff; }
tr:hover td { background: #f4f8ff; }

.actions-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: max-content;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* ---- DASHBOARD AVANÇADA ---- */
.dash-hero{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;background:linear-gradient(135deg,#0b1330 0%,#1e1b4b 55%,#312e81 100%);color:#fff;border-radius:18px;padding:1.5rem 1.75rem;margin-bottom:1.5rem;box-shadow:0 20px 40px -22px rgba(49,46,129,.6);position:relative;overflow:hidden}
.dash-hero::after{content:"";position:absolute;right:-40px;top:-40px;width:200px;height:200px;border-radius:50%;background:radial-gradient(circle,rgba(124,130,255,.35),transparent 70%)}
.dash-hero__txt h2{font-size:1.5rem;font-weight:800;letter-spacing:-.02em;margin-bottom:.25rem}
.dash-hero__txt p{font-size:.9rem;color:#c7d2fe}
.dash-hero__date{position:relative;z-index:1;text-align:right;font-size:.82rem;color:#c7d2fe}
.dash-hero__date strong{display:block;font-size:1.05rem;color:#fff;text-transform:capitalize}
.dash-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:1.5rem;align-items:start;margin-bottom:1.5rem}
@media(max-width:1000px){.dash-grid{grid-template-columns:1fr}}
.dash-panel{background:var(--card-bg);border:1px solid #dbe4f0;border-radius:16px;box-shadow:var(--shadow);overflow:hidden}
.dash-panel__head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:1.1rem 1.35rem;border-bottom:1px solid #eef2f8}
.dash-panel__head h3{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:800;color:var(--primary)}
.dash-panel__head h3 i,.dash-panel__head h3 svg{width:18px;height:18px;color:var(--accent)}
.dash-panel__body{padding:1.1rem 1.35rem}
/* PNTP score */
.pntp-score{display:flex;align-items:center;gap:1.1rem;margin-bottom:1rem}
.pntp-ring{--val:0;width:96px;height:96px;border-radius:50%;flex-shrink:0;background:conic-gradient(var(--accent) calc(var(--val)*1%),#e9eef6 0);display:flex;align-items:center;justify-content:center;position:relative}
.pntp-ring::before{content:"";position:absolute;inset:9px;background:#fff;border-radius:50%}
.pntp-ring span{position:relative;z-index:1;font-size:1.35rem;font-weight:800;color:var(--primary)}
.pntp-score__txt{font-size:.88rem;color:var(--text-light);line-height:1.5}
.pntp-score__txt strong{color:var(--primary)}
.pntp-list{list-style:none;display:flex;flex-direction:column;gap:.45rem;max-height:330px;overflow-y:auto}
.pntp-li{display:flex;align-items:center;gap:.65rem;padding:.55rem .7rem;border-radius:10px;background:#f8fafd;border:1px solid #eef2f8;cursor:default}
.pntp-li[data-page]{cursor:pointer;transition:background .15s}
.pntp-li[data-page]:hover{background:#eef4ff}
.pntp-li__ic{width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:.8rem;font-weight:800}
.pntp-li__ic.ok{background:#dcfce7;color:#16a34a}
.pntp-li__ic.missing{background:#fee2e2;color:#dc2626}
.pntp-li__txt{flex:1;min-width:0}
.pntp-li__txt b{font-size:.85rem;color:var(--text-main);font-weight:700}
.pntp-li__txt small{display:block;font-size:.74rem;color:var(--text-light)}
.pntp-li__code{font-size:.66rem;font-weight:800;color:#94a3b8;background:#eef2f8;border-radius:6px;padding:.1rem .4rem}
/* Alerts */
.alert-list{display:flex;flex-direction:column;gap:.6rem;max-height:430px;overflow-y:auto}
.alert-item{display:flex;gap:.75rem;padding:.8rem .9rem;border-radius:12px;border:1px solid;align-items:flex-start}
.alert-item__ic{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.alert-item__ic i,.alert-item__ic svg{width:17px;height:17px}
.alert-item__bd{flex:1;min-width:0}
.alert-item__bd b{display:block;font-size:.86rem;font-weight:700;margin-bottom:.1rem}
.alert-item__bd p{font-size:.78rem;color:var(--text-light);line-height:1.4}
.alert-item__go{font-size:.72rem;font-weight:700;border:none;background:transparent;cursor:pointer;padding:.2rem .1rem;margin-top:.3rem}
.alert-item.danger{background:#fef2f2;border-color:#fecaca}.alert-item.danger .alert-item__ic{background:#fee2e2;color:#dc2626}.alert-item.danger .alert-item__go{color:#dc2626}
.alert-item.warn{background:#fffbeb;border-color:#fde68a}.alert-item.warn .alert-item__ic{background:#fef3c7;color:#d97706}.alert-item.warn .alert-item__go{color:#d97706}
.alert-item.info{background:#eff6ff;border-color:#bfdbfe}.alert-item.info .alert-item__ic{background:#dbeafe;color:#2563eb}.alert-item.info .alert-item__go{color:#2563eb}
.alert-item.ok{background:#f0fdf4;border-color:#bbf7d0}.alert-item.ok .alert-item__ic{background:#dcfce7;color:#16a34a}
/* AI analysis */
.ai-analysis{background:linear-gradient(135deg,#f5f7ff,#eef2ff);border:1px solid #dfe3ff;border-radius:16px;padding:1.35rem 1.5rem;margin-bottom:1.5rem}
.ai-analysis__head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:.5rem}
.ai-analysis__head h3{display:flex;align-items:center;gap:.5rem;font-size:1.05rem;font-weight:800;color:#3730a3}
.ai-analysis__out {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-top: 1rem;
  background: #fff;
  border: 1px solid var(--pm-gray-200);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  min-height: 60px;
  max-height: 520px;
  overflow-y: auto;
}
.ai-analysis__out:empty{display:none}
.ai-analysis__out .aia-h{font-size:.82rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#3730a3;margin:1.15rem 0 .55rem;padding-bottom:.35rem;border-bottom:1px solid #e7e9ff;display:flex;align-items:center;gap:.4rem}
.ai-analysis__out .aia-h:first-child{margin-top:0}
.ai-analysis__out .aia-h::before{content:"";width:8px;height:8px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#4f46e5);flex-shrink:0}
.ai-analysis__out .aia-p{margin:.5rem 0;color:var(--text-main)}
.ai-analysis__out .aia-p--ok{color:#166534;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:.55rem .75rem;font-size:.85rem;display:flex;align-items:center;gap:.4rem}
.ai-analysis__out .aia-p--warn{color:#92400e;background:#fffbeb;border:1px solid #fde68a;border-radius:8px;padding:.55rem .75rem;font-size:.85rem;display:flex;align-items:center;gap:.4rem}
.pntp-cartilha-status{display:block;margin-top:.45rem;font-size:.74rem;line-height:1.35}
.pntp-cartilha-status.is-ok{color:#166534}
.pntp-cartilha-status.is-miss{color:#b45309}
.ai-analysis__out .aia-ul{list-style:none;margin:.75rem 0 1rem;padding:0;display:flex;flex-direction:column;gap:.65rem}
.ai-analysis__out .aia-ul li{position:relative;padding:.75rem 1rem .75rem 2.35rem;background:#fff;border:1px solid var(--pm-gray-200);border-radius:12px;font-size:.86rem;line-height:1.55;box-shadow:var(--pm-shadow-sm)}
.ai-analysis__out .aia-ul li::before{content:"✓";position:absolute;left:.85rem;top:.78rem;width:18px;height:18px;font-size:.72rem;font-weight:800;color:#16a34a;display:flex;align-items:center;justify-content:center;background:#dcfce7;border-radius:50%}
.ai-analysis__out .aia-ul li strong{color:var(--primary)}
.ai-analysis__out .aia-p{margin:.55rem 0 .75rem;line-height:1.6}
.ai-analysis__out .aia-h{margin:1.35rem 0 .75rem}
.ai-analysis__out .aia-issues{display:flex;flex-direction:column;gap:.85rem;margin:.75rem 0 1.1rem}
.ai-analysis__out .aia-issue{background:#fff;border:1px solid var(--pm-gray-200);border-radius:14px;padding:1rem 1.1rem;box-shadow:var(--pm-shadow-sm)}
.ai-analysis__out .aia-issue__title{font-weight:700;font-size:.92rem;color:var(--pm-blue-900);line-height:1.45;display:flex;align-items:flex-start;gap:.6rem;margin:0 0 .65rem}
.ai-analysis__out .aia-issue__title::before{content:"!";flex-shrink:0;width:24px;height:24px;border-radius:50%;background:#fef3c7;color:#b45309;font-size:.78rem;font-weight:800;display:inline-flex;align-items:center;justify-content:center;margin-top:.05rem}
.ai-analysis__out .aia-issue__row{margin:.45rem 0 0;padding:.6rem .75rem;border-radius:10px;font-size:.84rem;line-height:1.55;color:var(--pm-gray-800)}
.ai-analysis__out .aia-issue__row--criterion{background:var(--pm-gray-50);border-left:3px solid var(--pm-blue-400)}
.ai-analysis__out .aia-issue__row--action{background:#f0fdf4;border-left:3px solid var(--pm-green-500)}
.ai-analysis__out .aia-issue__row-label{display:block;font-weight:700;font-size:.68rem;text-transform:uppercase;letter-spacing:.04em;color:var(--pm-gray-500);margin-bottom:.25rem}
.ai-analysis__out .aia-steps{counter-reset:aia-step;list-style:none;margin:.75rem 0 1rem;padding:0;display:flex;flex-direction:column;gap:.65rem}
.ai-analysis__out .aia-steps li{counter-increment:aia-step;position:relative;padding:.75rem 1rem .75rem 2.75rem;background:#fff;border:1px solid var(--pm-gray-200);border-radius:12px;font-size:.86rem;line-height:1.55;box-shadow:var(--pm-shadow-sm)}
.ai-analysis__out .aia-steps li::before{content:counter(aia-step);position:absolute;left:.85rem;top:.72rem;width:22px;height:22px;font-size:.72rem;font-weight:800;color:#fff;background:var(--pm-blue-600);border-radius:50%;display:flex;align-items:center;justify-content:center}
.ai-analysis__out.is-loading{color:var(--text-light)}
.dist-bars{display:flex;flex-direction:column;gap:.6rem}
.dist-row{display:grid;grid-template-columns:130px 1fr 42px;align-items:center;gap:.6rem;font-size:.82rem}
.dist-row .dist-label{color:var(--text-light);font-weight:600}
.dist-track{height:9px;background:#eef2f8;border-radius:99px;overflow:hidden}
.dist-fill{height:100%;border-radius:99px;background:linear-gradient(90deg,var(--accent),var(--accent-light))}
.dist-row .dist-val{text-align:right;font-weight:800;color:var(--primary)}
.kpi-sub{font-size:.72rem;color:var(--text-light);margin-top:.15rem;font-weight:600}
.site-toggle{display:flex;align-items:center;gap:.6rem;padding:.65rem .85rem;border:1px solid var(--border);border-radius:10px;background:#f8fafd;cursor:pointer;font-size:.88rem;font-weight:600;color:var(--text-main);transition:background .15s,border-color .15s}
.site-toggle:hover{background:#eef4ff;border-color:var(--accent-light)}
.site-toggle input{width:18px;height:18px;cursor:pointer;accent-color:var(--accent)}
#page-site input[type=color]{border:1px solid var(--border);border-radius:8px;background:#fff}
.badge-green { background: #e6fcf5; color: #0ca678; }
.badge-blue { background: #e7f5ff; color: #1c7ed6; }
.badge-gray { background: #f1f3f5; color: #495057; }
.badge-red { background: #fff5f5; color: #f03e3e; }
.badge-gold { background: #fff9db; color: #f08c00; }

.form-card { max-width: 900px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-group { margin-bottom: 1.35rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  background: #fff;
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-full { grid-column: 1 / -1; }

/* ---- IMAGE UPLOADER COMPONENT ---- */
.img-uploader {
  display: flex;
  gap: 1rem;
  align-items: center;
  border: 1.5px dashed #c7d2e3;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #fafcff;
  transition: var(--transition);
}
.img-uploader:hover { border-color: var(--accent-light); background: #f5f7ff; }
.img-uploader-thumb {
  width: 104px;
  height: 74px;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #eef2f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  overflow: hidden;
}
.img-uploader-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-uploader-ph { display: flex; align-items: center; justify-content: center; }
.img-uploader-ph i, .img-uploader-ph svg, .img-uploader-ph .lucide { width: 26px; height: 26px; }
.img-uploader-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.img-uploader-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.img-uploader-url {
  width: 100%;
  font-size: 0.8rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  background: #fff;
  font-family: inherit;
}
.img-uploader-url:focus { outline: none; border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.img-uploader-hint { font-size: 0.72rem; color: #94a3b8; }
.btn-blue { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); color: #fff; box-shadow: 0 4px 12px rgba(2,132,199,0.2); }
.btn-blue:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(2,132,199,0.3); }

/* ---- INLINE AI HELPERS ---- */
.btn-ia-inline {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.15);
  vertical-align: middle;
}
.btn-ia-inline:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.25);
  filter: brightness(1.1);
}
.btn-ia-inline i, .btn-ia-inline svg, .btn-ia-inline .lucide {
  width: 12px; height: 12px;
}

.ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ai-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.ai-modal {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-modal-overlay.active .ai-modal {
  transform: scale(1);
}
.ai-modal-header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-modal-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
}
.ai-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.ai-modal-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}
.ai-modal-select {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  background: #fff;
  font-family: inherit;
}
.ai-modal-select:focus {
  border-color: var(--accent-light);
}
.ai-modal--wide { max-width: 980px; }
.ai-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.ai-modal-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.ai-modal-hint { font-size: 0.75rem; color: var(--pm-gray-500); margin: 0.35rem 0 0; }
.ai-modal-file { margin-top: 0.5rem; font-size: 0.82rem; width: 100%; }
.ai-context-box { margin-bottom: 0; }
.ai-context-preview {
  background: var(--pm-gray-50);
  border: 1px solid var(--pm-gray-200);
  border-radius: var(--pm-radius-md);
  padding: 0.65rem 0.75rem;
  max-height: 140px;
  overflow-y: auto;
  font-size: 0.78rem;
}
.ai-context-list { margin: 0; padding-left: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.ai-preview-container--stack { grid-template-columns: 1fr; max-height: none; }
.ai-preview-container--stack .ai-preview-box textarea { min-height: 120px; }
#aiModalSourceWrap.is-optional textarea { border-style: dashed; }
.form-section__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.form-section__title-row .form-section__title { margin-bottom: 0; }
@media (max-width: 768px) {
  .ai-modal-grid { grid-template-columns: 1fr; }
}
.ai-preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-height: 220px;
  max-height: 400px;
}
@media (max-width: 600px) {
  .ai-preview-container {
    grid-template-columns: 1fr;
  }
}
.ai-preview-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ai-preview-box label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
}
.ai-preview-box textarea {
  flex: 1;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
}
.ai-preview-box.result textarea {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

/* ---- INLINE DETAIL IA ASSISTANT ---- */
.ai-detail-chat-box {
  margin-top: 1.5rem;
  border-top: 2px dashed var(--border);
  padding-top: 1.5rem;
}
.ai-detail-chat-card {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.ai-detail-chat-header {
  background: linear-gradient(135deg, var(--pm-blue-800) 0%, var(--pm-blue-600) 100%);
  color: white;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-detail-chat-messages {
  padding: 1.25rem;
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-detail-chat-bubble {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  max-width: 85%;
  font-size: 0.875rem;
  line-height: 1.45;
}
.ai-detail-chat-bubble.user {
  background: #e0e7ff;
  color: #312e81;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.ai-detail-chat-bubble.model {
  background: #fff;
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border);
}
.ai-detail-chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 0.85rem 1.25rem;
  background: #fff;
  border-top: 1px solid var(--border);
}
.ai-detail-chat-input-wrap input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-size: 0.875rem;
  font-family: inherit;
}
.ai-detail-chat-input-wrap input:focus {
  border-color: var(--accent);
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: #090b17;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  overflow: hidden;
}

html.auth-session #loginOverlay {
  display: none !important;
}
.login-bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
  animation: floatOrb 12s infinite alternate ease-in-out;
}
.login-bg-glow-2 {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(60px);
  z-index: 1;
  pointer-events: none;
  animation: floatOrb2 16s infinite alternate ease-in-out;
}
@keyframes floatOrb {
  0% { transform: translate(-100px, -100px); }
  100% { transform: translate(100px, 100px); }
}
@keyframes floatOrb2 {
  0% { transform: translate(150px, 80px); }
  100% { transform: translate(-150px, -80px); }
}
.login-box {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  z-index: 2;
  color: #fff;
  transition: var(--transition);
}
.login-logo {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}
.login-box h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.login-box p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 2.2rem;
}
.login-box label {
  color: #cbd5e1;
}
.login-box input {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}
.login-box input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-light);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.alert-err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-ok { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ==========================================================================
   Phase 1+ — Shell & layout
   ========================================================================== */
body {
  font-family: var(--pm-font-body);
  background: var(--pm-surface-muted);
}
h1, h2, h3, h4, .section-header h2, .topbar h1 {
  font-family: var(--pm-font-heading);
}

.sidebar {
  background: var(--pm-blue-900);
  box-shadow: 2px 0 24px rgba(10, 30, 74, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-logo-mark {
  background: var(--pm-blue-500);
  box-shadow: 0 4px 12px rgba(37, 87, 180, 0.35);
  border-radius: var(--pm-radius-lg);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left: 3px solid var(--pm-blue-400);
  box-shadow: none;
}
.sidebar.collapsed .nav-item.active {
  background: rgba(59, 114, 212, 0.2);
}
.nav-item--featured {
  background: var(--pm-blue-600) !important;
  color: #fff !important;
  font-weight: 600;
  margin-bottom: var(--pm-gap-md);
  box-shadow: 0 4px 12px rgba(10, 30, 74, 0.25);
}
.nav-item--featured i, .nav-item--featured svg { color: #fff !important; }
.nav-item--featured.is-exit {
  background: var(--pm-red-500) !important;
}

.topbar {
  background: var(--pm-white);
  backdrop-filter: none;
  border-bottom: 1px solid var(--pm-gray-200);
  box-shadow: var(--pm-shadow-sm);
  padding: 0.75rem var(--pm-gap-xl);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--pm-gray-500);
  margin-top: 0.15rem;
}
.breadcrumb span { color: var(--pm-gray-400); }
.breadcrumb strong { color: var(--pm-blue-600); font-weight: 600; }
.user-badge { box-shadow: none; }
.user-role {
  background: var(--pm-blue-50);
  color: var(--pm-blue-600);
}
.user-avatar {
  background: var(--pm-blue-500);
  box-shadow: none;
}

.content {
  padding: var(--pm-gap-xl);
  max-width: 1280px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--pm-gap-lg);
  margin-bottom: var(--pm-gap-lg);
  flex-wrap: wrap;
}
.page-header__main h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pm-blue-900);
  letter-spacing: -0.02em;
}
.page-header__main p {
  font-size: 0.875rem;
  color: var(--pm-gray-500);
  margin-top: 0.25rem;
}
.page-header__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Login institucional */
.login-overlay {
  background: var(--pm-blue-900);
}
.login-bg-glow, .login-bg-glow-2 { display: none; }
.login-box {
  background: var(--pm-white);
  color: var(--pm-gray-900);
  border: 1px solid var(--pm-gray-200);
  box-shadow: var(--pm-shadow-lg);
  padding: 2.5rem 2rem;
}
.login-box h2 { color: var(--pm-blue-900); }
.login-box p { color: var(--pm-gray-500); }
.login-box label { color: var(--pm-gray-700); }
.login-box input {
  background: var(--pm-white);
  border: 1.5px solid var(--pm-gray-300);
  color: var(--pm-gray-900);
}
.login-box input:focus {
  border-color: var(--pm-blue-400);
  box-shadow: 0 0 0 3px var(--pm-blue-100);
}
.login-logo-mark {
  width: 64px; height: 64px;
  background: var(--pm-blue-500);
  border-radius: var(--pm-radius-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(37, 87, 180, 0.25);
}
.login-logo-mark i, .login-logo-mark svg { width: 32px; height: 32px; color: #fff; }

/* Cards — sem hover em dados */
.card { border: 1px solid var(--pm-gray-200); box-shadow: var(--pm-shadow-sm); }
.card:hover { transform: none; box-shadow: var(--pm-shadow-sm); }
.card--interactive:hover { box-shadow: var(--pm-shadow-md); }
.table-wrap, .dash-panel, .stat-card { transition: box-shadow 0.2s; }
.stat-card:hover { transform: none; box-shadow: var(--pm-shadow-md); }

.btn-primary {
  background: var(--pm-blue-500);
  box-shadow: 0 2px 8px rgba(37, 87, 180, 0.2);
}
.btn-primary:hover { background: var(--pm-blue-600); transform: none; }
.btn-green { background: var(--pm-green-600); box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2); }
.btn-green:hover { background: var(--pm-green-700); transform: none; }
.btn-danger { background: var(--pm-red-500); }
.btn-danger:hover { background: var(--pm-red-600); transform: none; }
.btn-gold { background: var(--pm-gold-500); }
.btn-secondary { background: var(--pm-white); border-color: var(--pm-gray-300); }
.btn-secondary:hover { background: var(--pm-gray-50); }

/* Phase 2 — Tables & forms */
.table-wrap { border: 1px solid var(--pm-gray-200); }
.table-wrap table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--pm-gray-50);
}
tr:nth-child(even) td { background: var(--pm-gray-50); }
tr:hover td { background: var(--pm-blue-50); }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pm-radius-md);
  border: 1px solid var(--pm-gray-200);
  background: var(--pm-white);
  color: var(--pm-gray-600);
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover { background: var(--pm-blue-50); border-color: var(--pm-blue-200); color: var(--pm-blue-600); }
.btn-icon--danger:hover { background: #fef2f2; border-color: #fecaca; color: var(--pm-red-500); }
.btn-icon--edit:hover { background: #fffbeb; border-color: #fde68a; color: var(--pm-gold-600); }
.btn-icon i, .btn-icon svg { width: 16px; height: 16px; }

.table-thumb {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: var(--pm-radius-md);
  border: 1px solid var(--pm-gray-200);
}
.table-thumb-ph {
  width: 48px; height: 48px;
  border-radius: var(--pm-radius-md);
  background: var(--pm-gray-100);
  border: 1px solid var(--pm-gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pm-gray-400);
}
.table-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--pm-gray-500);
}
.table-empty i, .table-empty svg { width: 40px; height: 40px; color: var(--pm-gray-300); margin-bottom: 0.75rem; }
.table-empty p { margin-bottom: 1rem; font-size: 0.9rem; }

.form-shell { max-width: 900px; margin: 0 auto; }
.form-shell__header {
  display: flex;
  align-items: center;
  gap: var(--pm-gap-md);
  margin-bottom: var(--pm-gap-lg);
  padding-bottom: var(--pm-gap-md);
  border-bottom: 1px solid var(--pm-gray-200);
}
.form-shell__header h2 { font-size: 1.25rem; font-weight: 700; color: var(--pm-blue-900); flex: 1; }
.form-section {
  margin-bottom: var(--pm-gap-lg);
  padding-bottom: var(--pm-gap-lg);
  border-bottom: 1px solid var(--pm-gray-100);
}
.form-section:last-of-type { border-bottom: none; }
.form-section__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pm-gray-500);
  margin-bottom: var(--pm-gap-md);
}
.form-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: var(--pm-gap-lg);
  margin-top: var(--pm-gap-md);
  border-top: 1px solid var(--pm-gray-200);
  position: sticky;
  bottom: 0;
  background: var(--pm-white);
  padding-bottom: 0.5rem;
}
.form-group input, .form-group select, .form-group textarea {
  min-height: 44px;
  border-color: var(--pm-gray-300);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--pm-blue-400);
  box-shadow: 0 0 0 3px var(--pm-blue-100);
}

.file-uploader-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.file-uploader-row input[type="text"] { flex: 1; min-width: 200px; }

.badge--success, .badge-green { background: var(--pm-green-100); color: var(--pm-green-700); }
.badge--warning, .badge-gold { background: var(--pm-gold-100); color: var(--pm-gold-600); }
.badge--danger, .badge-red { background: var(--pm-red-100); color: var(--pm-red-600); }
.badge--neutral, .badge-gray { background: var(--pm-gray-100); color: var(--pm-gray-700); }
.badge--info, .badge-blue { background: var(--pm-blue-100); color: var(--pm-blue-700); }

/* Phase 3 — Dashboard & IA */
.dash-hero {
  background: var(--pm-blue-900);
  box-shadow: var(--pm-shadow-md);
}
.dash-hero::after { display: none; }
.dash-hero__txt p { color: var(--pm-blue-100); }
.dash-hero__date { color: var(--pm-blue-100); }
.pntp-ring { background: conic-gradient(var(--pm-blue-500) calc(var(--val)*1%), var(--pm-gray-200) 0); }
.ai-analysis { background: var(--pm-blue-50); border-color: var(--pm-blue-200); }
.ai-analysis__head h3 { color: var(--pm-blue-800); }
.ai-analysis__out .aia-h { color: var(--pm-blue-700); }
.ai-analysis__out .aia-h::before { background: var(--pm-blue-500); }
.dist-fill { background: linear-gradient(90deg, var(--pm-blue-500), var(--pm-blue-400)); }

.ai-chat-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 240px;
  gap: var(--pm-gap-md);
  height: calc(100vh - 148px);
  min-height: 520px;
}
#page-ai-chat .page-header--compact {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
}
#page-ai-chat .page-header--compact h2 { font-size: 1.25rem; margin-bottom: 0.15rem; }
#page-ai-chat .page-header--compact p { font-size: 0.82rem; margin: 0; }
.ai-chat-history {
  display: flex;
  flex-direction: column;
  padding: 0.85rem;
  min-height: 0;
  overflow: hidden;
}
.ai-chat-history__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}
.ai-chat-history__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pm-blue-900);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.ai-chat-history__title i, .ai-chat-history__title svg { width: 16px; height: 16px; color: var(--pm-blue-500); }
.ai-chat-history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ai-chat-history__item {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  border-radius: var(--pm-radius-md);
}
.ai-chat-history__item.is-active {
  background: var(--pm-blue-50);
}
.ai-chat-history__btn {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.55rem 0.6rem;
  border-radius: var(--pm-radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ai-chat-history__btn:hover { background: var(--pm-gray-100); }
.ai-chat-history__item.is-active .ai-chat-history__btn { background: transparent; }
.ai-chat-history__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pm-gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-chat-history__date {
  font-size: 0.68rem;
  color: var(--pm-gray-500);
}
.ai-chat-history__del {
  flex-shrink: 0;
  width: 28px;
  border: none;
  background: transparent;
  color: var(--pm-gray-400);
  border-radius: var(--pm-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.ai-chat-history__item:hover .ai-chat-history__del { opacity: 1; }
.ai-chat-history__del:hover { color: #b91c1c; background: #fef2f2; }
.ai-chat-history__del i, .ai-chat-history__del svg { width: 14px; height: 14px; }
.ai-chat-history__empty {
  font-size: 0.75rem;
  text-align: center;
  padding: 1rem 0.5rem;
  margin: 0;
}
.ai-chat-sidebar {
  display: flex;
  flex-direction: column;
  padding: var(--pm-gap-md);
  gap: var(--pm-gap-md);
  min-height: 0;
  overflow: hidden;
}
.ai-chat-main {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-height: 0;
}
.ai-chat-header {
  background: var(--pm-blue-900);
  color: #fff;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 0.75rem;
}
.ai-chat-header__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.ai-chat-header__avatar {
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.ai-chat-status {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  display: flex; align-items: center; gap: 4px;
}
.ai-chat-status__dot {
  width: 6px; height: 6px;
  background: var(--pm-green-500);
  border-radius: 50%;
}
.ai-chat-messages {
  flex: 1 1 auto;
  min-height: 280px;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--pm-gray-50);
}
.ai-chat-input-bar {
  border-top: 1px solid var(--pm-gray-200);
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.75rem;
  background: var(--pm-white);
  align-items: flex-end;
  flex-shrink: 0;
}
.ai-chat-input-bar textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--pm-gray-300);
  border-radius: var(--pm-radius-md);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 52px;
  max-height: 140px;
  line-height: 1.45;
}
.ai-chat-send {
  flex-shrink: 0;
  min-height: 52px;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}
.ai-shortcut-btn { text-align: left; justify-content: flex-start; width: 100%; }

.modal-header, .ai-modal-header {
  background: var(--pm-blue-900);
  color: #fff;
}
.modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}
.modal-close:hover { opacity: 0.8; }

.site-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.site-toggle {
  border-color: var(--pm-gray-200);
  border-radius: var(--pm-radius-lg);
}
.site-toggle:has(input:checked) {
  background: var(--pm-blue-50);
  border-color: var(--pm-blue-300);
}
.color-swatch-wrap { display: flex; align-items: center; gap: 0.5rem; }
.color-swatch {
  width: 36px; height: 36px;
  border-radius: var(--pm-radius-md);
  border: 1px solid var(--pm-gray-300);
}

/* Phase 4 — Responsive, toast, a11y */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 74, 0.45);
  z-index: 199;
}
.sidebar-backdrop.is-visible { display: block; }

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.85rem 1.25rem;
  border-radius: var(--pm-radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--pm-shadow-lg);
  border: 1px solid;
  animation: toastIn 0.25s ease;
  max-width: 360px;
}
.toast--success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.toast--error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.toast--info { background: var(--pm-blue-50); color: var(--pm-blue-800); border-color: var(--pm-blue-200); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn.is-loading { opacity: 0.7; pointer-events: none; }
.skeleton {
  background: linear-gradient(90deg, var(--pm-gray-100) 25%, var(--pm-gray-200) 50%, var(--pm-gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--pm-radius-md);
  height: 1rem;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.hidden { display: none !important; }
.text-muted { font-size: 0.8rem; color: var(--pm-gray-500); }
.btn-block { width: 100%; min-height: 44px; }
.cell-ellipsis { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

:focus-visible {
  outline: 2px solid var(--pm-blue-400);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { width: 260px !important; }
  .main, body.sidebar-collapsed .main { margin-left: 0 !important; }
  .ai-chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: auto;
    min-height: calc(100vh - 140px);
  }
  .ai-chat-history { max-height: 160px; order: 1; }
  .ai-chat-main { order: 2; min-height: 420px; }
  .ai-chat-sidebar { order: 3; max-height: 240px; }
  .ai-chat-history__del { opacity: 1; }
}

@media (max-width: 768px) {
  .content { padding: var(--pm-gap-md); }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0.75rem var(--pm-gap-md); }
  .form-footer { flex-direction: column; }
  .form-footer .btn { width: 100%; }
}

@media (max-width: 480px) {
  .page-header { flex-direction: column; }
  .user-name { display: none; }
}

/* AI Chat components */
.ai-chat-sidebar__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pm-blue-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.ai-chat-sidebar__title i, .ai-chat-sidebar__title svg { width: 18px; height: 18px; color: var(--pm-blue-500); }
.ai-chat-shortcuts { display: flex; flex-direction: column; gap: 0.65rem; flex: 1; overflow-y: auto; }
.ai-chat-note { border-top: 1px solid var(--pm-gray-200); padding-top: 1rem; font-size: 0.75rem; }
.ai-chat-header__info { display: flex; align-items: center; gap: 0.75rem; }
.ai-chat-header h3 { font-size: 0.95rem; font-weight: 700; margin: 0; }
.ai-chat-clear { color: #fff !important; background: rgba(255,255,255,0.12) !important; border-color: rgba(255,255,255,0.2) !important; }
.ai-chat-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  font-size: 0.8rem;
  color: var(--pm-gray-500);
  background: var(--pm-gray-100);
}
.ai-chat-loading i, .ai-chat-loading svg { width: 14px; height: 14px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-chat-welcome { display: flex; gap: 0.75rem; max-width: 85%; }
.ai-chat-welcome__avatar {
  width: 28px; height: 28px;
  background: var(--pm-blue-700);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ai-chat-welcome__avatar i, .ai-chat-welcome__avatar svg { width: 14px; height: 14px; }
.ai-chat-welcome__bubble {
  background: var(--pm-white);
  border: 1px solid var(--pm-gray-200);
  padding: 1rem;
  border-radius: 0 12px 12px 12px;
  box-shadow: var(--pm-shadow-sm);
  font-size: 0.875rem;
}
.ai-chat-welcome__bubble p + p { margin-top: 0.35rem; color: var(--pm-gray-600); }
.ai-msg { display: flex; gap: 0.65rem; max-width: 85%; margin-bottom: 0.25rem; }
.ai-msg--user { margin-left: auto; flex-direction: row-reverse; }
.ai-msg__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.ai-msg--user .ai-msg__avatar { background: var(--pm-blue-500); }
.ai-msg--bot .ai-msg__avatar { background: var(--pm-blue-700); }
.ai-msg__avatar i, .ai-msg__avatar svg { width: 14px; height: 14px; }
.ai-msg__bubble {
  padding: 0.85rem 1.1rem;
  box-shadow: var(--pm-shadow-sm);
  font-size: 0.875rem;
  line-height: 1.5;
}
.ai-msg--user .ai-msg__bubble {
  background: var(--pm-blue-900);
  color: #fff;
  border-radius: 12px 12px 0 12px;
}
.ai-msg--bot .ai-msg__bubble {
  background: var(--pm-white);
  border: 1px solid var(--pm-gray-200);
  color: var(--pm-gray-900);
  border-radius: 0 12px 12px 12px;
}
.ai-sim-badge { margin-bottom: 0.5rem; display: inline-flex; align-items: center; gap: 4px; }

.ai-doc-upload {
  padding: 0;
  border-top: 1px solid var(--pm-gray-200);
  background: var(--pm-white);
  flex-shrink: 0;
}
.ai-doc-upload--collapsed { border-top: none; }
.ai-doc-upload__panel {
  padding: 0.85rem 1rem 0.75rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-top: 1px solid var(--pm-gray-200);
}
.ai-doc-upload__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
}
.ai-doc-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ai-doc-field--wide { grid-column: 1 / -1; }
.ai-doc-field--file { grid-column: 1 / -1; }
.ai-doc-upload__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pm-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ai-doc-upload__select,
.ai-doc-upload__instruction {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--pm-gray-300);
  border-radius: var(--pm-radius-md);
  font-size: 0.85rem;
  background: #fff;
}
.ai-doc-upload__file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.ai-doc-upload__name {
  flex: 1 1 10rem;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--pm-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-doc-upload__hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--pm-gray-500);
}
@media (max-width: 640px) {
  .ai-doc-upload__grid { grid-template-columns: 1fr; }
  .ai-doc-field--wide, .ai-doc-field--file { grid-column: auto; }
}
.ai-doc-user-msg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.ai-doc-user-msg i, .ai-doc-user-msg svg { width: 14px; height: 14px; }
.ai-doc-user-note { font-size: 0.85rem; opacity: 0.92; }
.ai-draft-actions__hint {
  font-size: 0.75rem;
  color: var(--pm-gray-600);
  margin: 0 0 0.5rem;
  width: 100%;
}
.ai-doc-saved {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ai-doc-saved a { color: var(--pm-blue-700); word-break: break-all; }
.ai-draft-preview-modal { max-width: 640px; text-align: left; }
.ai-draft-preview-modal h3 { text-align: center; }
.ai-draft-preview-body { max-height: 280px; overflow: auto; margin: 0.75rem 0; }
.ai-draft-preview-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ai-draft-preview-table th,
.ai-draft-preview-table td { border: 1px solid var(--pm-gray-200); padding: 0.45rem 0.55rem; vertical-align: top; text-align: left; }
.ai-draft-preview-table th { width: 38%; background: var(--pm-gray-50); font-weight: 600; }
.ai-draft-preview-doc { margin: 0.5rem 0 0.75rem; }
.ai-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.form-checks { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.form-check {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; cursor: pointer;
}
.form-check input { width: auto; accent-color: var(--pm-blue-500); }

.gallery-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0.75rem;
}

.alert-item__bd b { font-size: 0.9rem; }
.alert-item__bd p { font-size: 0.875rem; }

.ai-modal--narrow { max-width: 550px; }
.ai-image-preview {
  text-align: center;
  padding: 1rem;
  border: 1px solid var(--pm-gray-200);
  border-radius: var(--pm-radius-lg);
  background: var(--pm-gray-50);
}
.ai-image-preview img { max-width: 100%; max-height: 220px; border-radius: var(--pm-radius-md); border: 1px solid var(--pm-gray-200); }

.dash-grid--half { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .dash-grid--half { grid-template-columns: 1fr; } }
.color-swatch-row { display: flex; gap: 0.5rem; align-items: center; }
.color-swatch-row input[type="color"] { width: 48px; height: 40px; padding: 2px; cursor: pointer; border-radius: var(--pm-radius-md); border: 1px solid var(--pm-gray-300); }
.color-swatch-row input[type="text"] { flex: 1; }
.settings-panel__title { font-family: var(--pm-font-heading); font-size: 1.1rem; font-weight: 700; color: var(--pm-blue-800); }
.cursor-pointer { cursor: pointer; }


/* ==========================================================================
   Design polish v3
   ========================================================================== */
.section-header {
  padding-bottom: var(--pm-gap-md);
  border-bottom: 1px solid var(--pm-gray-200);
  margin-bottom: var(--pm-gap-lg);
  gap: var(--pm-gap-md);
  flex-wrap: wrap;
}
.section-header h2 {
  font-family: var(--pm-font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pm-blue-900);
}
.section-header .btn-green,
.section-header .btn-primary {
  background: var(--pm-blue-500);
  box-shadow: 0 2px 8px rgba(37, 87, 180, 0.18);
}
.section-header .btn-green:hover { background: var(--pm-blue-600); }

.stat-card__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.stat-card__icon {
  width: 40px; height: 40px;
  border-radius: var(--pm-radius-lg);
  display: flex; align-items: center; justify-content: center;
  background: var(--pm-blue-50);
  color: var(--pm-blue-500);
  flex-shrink: 0;
}
.stat-card.green .stat-card__icon { background: var(--pm-green-100); color: var(--pm-green-600); }
.stat-card.gold .stat-card__icon { background: var(--pm-gold-100); color: var(--pm-gold-600); }
.stat-card.red .stat-card__icon { background: var(--pm-red-100); color: var(--pm-red-500); }
.stat-card__icon i, .stat-card__icon svg { width: 20px; height: 20px; }
.stat-card::before { display: none; }

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pm-gap-md);
  margin-bottom: var(--pm-gap-lg);
  padding-bottom: var(--pm-gap-md);
  border-bottom: 1px solid var(--pm-gray-200);
}
.detail-header h2 {
  font-family: var(--pm-font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pm-blue-900);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--pm-gap-lg);
  margin-bottom: var(--pm-gap-lg);
}
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-field { font-size: 0.9rem; }
.detail-field strong { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pm-gray-500); margin-bottom: 0.2rem; }
.detail-section {
  margin-top: var(--pm-gap-md);
  padding-top: var(--pm-gap-lg);
  border-top: 1px solid var(--pm-gray-200);
}
.detail-section h4 {
  font-family: var(--pm-font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pm-blue-800);
  margin-bottom: 0.5rem;
}
.detail-content-box {
  background: var(--pm-gray-50);
  padding: 1.1rem 1.25rem;
  border-radius: var(--pm-radius-lg);
  border: 1px solid var(--pm-gray-200);
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.9rem;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: var(--pm-gap-lg);
  padding-top: var(--pm-gap-lg);
  border-top: 1px solid var(--pm-gray-200);
}
.detail-loading {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--pm-gray-500);
}
.detail-loading i, .detail-loading svg { width: 24px; height: 24px; animation: spin 1s linear infinite; }
.detail-card { padding: var(--pm-gap-xl); }

.code-block {
  background: var(--pm-gray-100);
  border: 1px solid var(--pm-gray-300);
  padding: 0.75rem;
  border-radius: var(--pm-radius-md);
  font-family: ui-monospace, monospace;
  overflow-x: auto;
  margin: 0.5rem 0;
  font-size: 0.82rem;
}

.table-wrap { overflow: hidden; }
.table-wrap table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.table-wrap .table-toolbar {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--pm-gray-200);
  background: var(--pm-gray-50);
  font-size: 0.82rem;
  color: var(--pm-gray-500);
}

.ai-analysis > p { font-size: 0.875rem; color: var(--pm-gray-500); margin-bottom: 0.5rem; }

.settings-panel h3 {
  font-family: var(--pm-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pm-blue-800);
  margin-bottom: 0.35rem;
}
.settings-panel .text-muted { margin-bottom: 1rem; }

.ai-detail-chat-bubble.model.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

/* Override legacy gradients that leak from base CSS */
.btn-primary { background: var(--pm-blue-500) !important; }
.btn-green { background: var(--pm-green-600) !important; }
.card:not(.card--interactive):hover { transform: none !important; }


/* ==========================================================================
   Design polish v4
   ========================================================================== */
body {
  font-family: var(--pm-font-body);
  background:
    radial-gradient(circle at 12% -8%, rgba(37, 87, 180, 0.06), transparent 38%),
    radial-gradient(circle at 88% -12%, rgba(30, 70, 148, 0.05), transparent 34%),
    var(--bg-main);
}

.icon-14 svg, .icon-14 i, i.icon-14, svg.icon-14 { width: 14px; height: 14px; }
.icon-16 svg, .icon-16 i, i.icon-16, svg.icon-16 { width: 16px; height: 16px; }
.icon-18 svg, .icon-18 i, i.icon-18, svg.icon-18 { width: 18px; height: 18px; }

.th-narrow { width: 80px; }
.gallery-upload-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.gallery-upload-row .text-muted { font-size: 0.8rem; }

.detail-content-box--scroll {
  max-height: 400px;
  overflow-y: auto;
}
.detail-content-box--html { white-space: normal; }
.detail-content-box--mono {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
.detail-summary {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.55;
}
.detail-ai-summary {
  background: #ecfdf5;
  color: #065f46;
  padding: 1.1rem 1.25rem;
  border-radius: var(--pm-radius-lg);
  border: 1px solid #a7f3d0;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.9rem;
}
.detail-title-emphasis {
  font-weight: 600;
  padding-bottom: 1rem;
  font-size: 0.95rem;
}
.detail-hero-img {
  max-height: 180px;
  border-radius: var(--pm-radius-md);
  border: 1px solid var(--pm-gray-200);
}
.detail-gallery {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-gallery img {
  max-height: 100px;
  border-radius: var(--pm-radius-sm);
  border: 1px solid var(--pm-gray-200);
}
.detail-accent { color: var(--accent); }
.detail-subject { font-weight: 600; font-size: 0.95rem; }

.social-settings-card {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--pm-gap-xl);
  background: var(--pm-surface);
  border-radius: var(--pm-radius-xl);
  box-shadow: var(--pm-shadow-md);
  border: 1px solid var(--pm-gray-200);
}
.social-settings-card__head {
  margin-bottom: var(--pm-gap-lg);
  padding-bottom: var(--pm-gap-md);
  border-bottom: 1px solid var(--pm-gray-200);
}
.social-settings-card__head h3 {
  font-family: var(--pm-font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pm-blue-800);
}

.form-footer--flush {
  max-width: none;
  margin-top: 0.5rem;
  border: none;
  padding-top: 0;
}
.settings-action { margin-top: 1rem; }

.proto-outcome-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.proto-outcome-row select {
  max-width: 240px;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--pm-gray-200);
  border-radius: var(--pm-radius-md);
  font-size: 0.9rem;
  outline: none;
  background: var(--pm-surface);
  font-family: inherit;
}
.proto-outcome-row select:focus {
  border-color: var(--pm-blue-400);
  box-shadow: 0 0 0 3px rgba(37, 87, 180, 0.12);
}

.form-shell .form-section:first-of-type { padding-top: 0; }

.gallery-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--pm-radius-sm);
  overflow: hidden;
  border: 1px solid var(--pm-gray-300);
}
.gallery-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(198, 40, 40, 0.88);
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.gallery-preview-remove:hover { background: var(--pm-red-600); }

.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.gallery-admin-empty {
  grid-column: 1 / -1;
  padding: 2.5rem 1rem;
  text-align: center;
}

.gallery-admin-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pm-gray-300);
  border-radius: var(--pm-radius-md);
  overflow: hidden;
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-xs, 0 1px 2px rgba(15, 23, 42, 0.05));
}

.gallery-admin-card__thumb {
  aspect-ratio: 4 / 3;
  background: var(--pm-gray-100);
}

.gallery-admin-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-admin-card__body {
  padding: 0.85rem 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gallery-admin-card__title {
  font-size: 0.9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-admin-card__meta {
  font-size: 0.78rem;
  color: var(--text-light);
}

.gallery-admin-card__actions {
  margin-top: 0.35rem;
}

.gallery-admin-card--hidden {
  opacity: 0.72;
}

.gallery-admin-card--hidden .gallery-admin-card__thumb img {
  filter: grayscale(0.35);
}

.gallery-admin-card__check {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--pm-radius-sm);
  padding: 0.2rem 0.35rem;
  box-shadow: var(--pm-shadow-xs, 0 1px 2px rgba(15, 23, 42, 0.08));
}

.gallery-admin-card {
  position: relative;
}

.gallery-admin-card__thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  background: var(--pm-gray-100);
}

.gallery-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.gallery-admin-toolbar__stats {
  font-size: 0.9rem;
}

.gallery-admin-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  flex: 1 1 260px;
}

.gallery-admin-filter {
  min-width: 150px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--pm-gray-300);
  border-radius: var(--pm-radius-sm);
  background: var(--pm-surface);
}

.gallery-admin-toolbar__bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.gallery-admin-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.15rem;
  font-size: 0.82rem;
  color: var(--text-light);
  white-space: nowrap;
}

.gallery-admin-select-all input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.gallery-admin-toolbar__bulk .btn-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.gallery-admin-card__actions .btn-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex: 0 0 32px;
}

.gallery-admin-card__actions .actions-group {
  flex-wrap: wrap;
}

.settings-action--row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gallery-dropzone {
  border: 2px dashed var(--pm-gray-300);
  border-radius: var(--pm-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.gallery-dropzone.is-dragover,
.gallery-dropzone:hover {
  border-color: var(--pm-blue-400);
  background: #eef4ff;
  box-shadow: 0 0 0 3px rgba(37, 87, 180, 0.08);
}

.gallery-dropzone.is-uploading {
  opacity: 0.65;
  pointer-events: none;
}

.gallery-dropzone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--text-light);
}

.gallery-dropzone__inner i,
.gallery-dropzone__inner svg {
  width: 2rem;
  height: 2rem;
  color: var(--pm-blue-500);
}

.gallery-dropzone__inner strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

.gallery-dropzone__ai {
  margin-top: 0.65rem;
  font-size: 0.82rem;
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.input-with-action input {
  flex: 1;
  min-width: 0;
}

.input-with-action .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.topbar-cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--pm-radius-md);
  border: 1px solid var(--pm-gray-300);
  background: var(--pm-white);
  color: var(--pm-gray-700);
  cursor: pointer;
  font-size: 0.78rem;
}

.topbar-cmd-btn:hover {
  background: var(--pm-blue-50);
  border-color: var(--pm-blue-300);
  color: var(--pm-blue-700);
}

.topbar-cmd-btn i,
.topbar-cmd-btn svg {
  width: 16px;
  height: 16px;
}

.topbar-cmd-btn__hint {
  opacity: 0.7;
}

.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 1rem;
}

.cmd-palette-overlay.hidden {
  display: none;
}

.cmd-palette {
  width: min(560px, 96vw);
  background: #fff;
  border-radius: var(--pm-radius-xl);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  border: 1px solid var(--pm-gray-200);
}

.cmd-palette__search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--pm-gray-200);
}

.cmd-palette__search input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 0.95rem;
  background: transparent;
}

.cmd-palette__search kbd {
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--pm-gray-100);
  color: var(--pm-gray-600);
}

.cmd-palette__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  max-height: 360px;
  overflow: auto;
}

.cmd-palette__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: var(--pm-radius-md);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.cmd-palette__item:hover,
.cmd-palette__item.is-active {
  background: var(--pm-blue-50);
}

.cmd-palette__item i,
.cmd-palette__item svg {
  width: 18px;
  height: 18px;
  color: var(--pm-blue-600);
  flex: 0 0 18px;
}

.cmd-palette__item strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-main);
}

.cmd-palette__item small {
  display: block;
  font-size: 0.76rem;
  color: var(--text-light);
}

.cmd-palette__empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.88rem;
}

.gal-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gal-preview-modal.hidden {
  display: none;
}

.gal-preview-modal__box {
  position: relative;
  max-width: min(960px, 96vw);
  max-height: 90vh;
}

.gal-preview-modal__box img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 3rem);
  margin: 0 auto;
  border-radius: var(--pm-radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.gal-preview-modal__title {
  color: #fff;
  text-align: center;
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
}

.gal-preview-modal__close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #0f172a;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.dist-empty {
  color: var(--text-light);
  font-size: 0.85rem;
}

.ai-detail-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.btn-chip {
  font-size: 0.75rem;
  padding: 3px 8px;
  font-weight: 600;
}
.ai-detail-send {
  padding: 0.5rem 0.85rem;
  border-radius: var(--pm-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-draft-actions__hint {
  font-size: 0.75rem;
  color: var(--pm-gray-600);
  margin: 0 0 0.5rem;
  width: 100%;
}
.ai-doc-saved {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ai-doc-saved a { color: var(--pm-blue-700); word-break: break-all; }
.ai-draft-preview-modal { max-width: 640px; text-align: left; }
.ai-draft-preview-modal h3 { text-align: center; }
.ai-draft-preview-body { max-height: 280px; overflow: auto; margin: 0.75rem 0; }
.ai-draft-preview-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ai-draft-preview-table th,
.ai-draft-preview-table td { border: 1px solid var(--pm-gray-200); padding: 0.45rem 0.55rem; vertical-align: top; text-align: left; }
.ai-draft-preview-table th { width: 38%; background: var(--pm-gray-50); font-weight: 600; }
.ai-draft-preview-doc { margin: 0.5rem 0 0.75rem; }
.ai-draft-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-inline-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-gallery-img {
  max-height: 100px;
  border-radius: var(--pm-radius-sm);
  border: 1px solid var(--pm-gray-200);
}


/* ==========================================================================
   Design polish v5 — sidebar institucional & refinamentos
   ========================================================================== */
.sidebar {
  background: linear-gradient(180deg, var(--pm-blue-900) 0%, var(--pm-blue-800) 50%, #081633 100%);
  box-shadow: 6px 0 32px rgba(10, 30, 74, 0.28);
}
.sidebar-logo-mark {
  background: linear-gradient(135deg, var(--pm-blue-500) 0%, var(--pm-blue-400) 100%);
  box-shadow: 0 4px 14px rgba(37, 87, 180, 0.35);
}
.nav-item:hover {
  background: rgba(59, 114, 212, 0.16);
  color: #fff;
}
.nav-item:hover i, .nav-item:hover svg { color: var(--pm-blue-200); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(37, 87, 180, 0.32), rgba(26, 58, 122, 0.2));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.nav-item.active i, .nav-item.active svg { color: var(--pm-blue-200); }
.sidebar.collapsed .nav-item.active {
  background: rgba(37, 87, 180, 0.28);
  border-left: none;
}
.nav-item--featured {
  margin-bottom: 0.65rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(230, 81, 0, 0.06));
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #fde68a;
}
.nav-item--featured i, .nav-item--featured svg { color: var(--pm-gold-500); }
.nav-item--featured:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(230, 81, 0, 0.1));
  color: #fff;
}
.nav-section { color: rgba(148, 163, 184, 0.65); }

.topbar {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--pm-gray-200);
}
.dash-hero__txt h2 { font-family: var(--pm-font-heading); }

.page-header + .table-wrap { margin-top: 0; }
.table-wrap {
  border-radius: var(--pm-radius-xl);
  box-shadow: var(--pm-shadow-sm);
}
.table-empty {
  padding: 3rem 1.5rem;
}
.table-empty p { color: var(--pm-gray-500); }

.form-shell__header h2 { font-family: var(--pm-font-heading); }
.detail-header h2 { font-family: var(--pm-font-heading); }

.stat-card::before { display: none !important; }
.stat-num { font-family: var(--pm-font-heading); }

.user-badge {
  border: 1px solid var(--pm-gray-200);
  background: var(--pm-gray-50);
  border-radius: var(--pm-radius-lg);
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
}
.user-avatar {
  background: var(--pm-blue-500);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
}

.breadcrumb { font-size: 0.78rem; }
.breadcrumb strong { color: var(--pm-blue-700); font-weight: 600; }

.ai-chat-sidebar__title { font-family: var(--pm-font-heading); color: var(--pm-blue-900); }


/* ==========================================================================
   Design polish v6 — premium visual layer
   ========================================================================== */

/* Eliminar roxo residual do CSS base */
.nav-item.active {
  border-left: 3px solid var(--pm-blue-400) !important;
  background: linear-gradient(135deg, rgba(37, 87, 180, 0.32), rgba(26, 58, 122, 0.18)) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}
.nav-item:hover {
  background: rgba(59, 114, 212, 0.16) !important;
}
.nav-item:hover i, .nav-item:hover svg { color: var(--pm-blue-300) !important; }
.sidebar.collapsed .nav-item.active {
  background: rgba(37, 87, 180, 0.28) !important;
  border-left: none !important;
}
.user-avatar {
  background: linear-gradient(135deg, var(--pm-blue-500), var(--pm-blue-400)) !important;
  box-shadow: 0 2px 10px rgba(37, 87, 180, 0.28) !important;
}

.topbar h1 {
  font-family: var(--pm-font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.page-header__main h2 {
  font-family: var(--pm-font-heading);
  letter-spacing: -0.025em;
  font-size: 1.45rem;
}

/* Login premium */
.login-overlay {
  background:
    radial-gradient(ellipse 80% 55% at 15% 5%, rgba(59, 114, 212, 0.28), transparent),
    radial-gradient(ellipse 55% 45% at 90% 95%, rgba(37, 87, 180, 0.18), transparent),
    var(--pm-blue-900);
}
.login-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.login-box {
  position: relative;
  overflow: hidden;
  border-radius: 1.125rem;
  max-width: 420px;
  padding-top: 2.75rem;
}
.login-box__accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pm-blue-500), var(--pm-blue-300), var(--pm-gold-500));
}
.login-box .form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pm-gray-600);
}
.login-box .btn-block {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
}

/* Dashboard hero */
.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.125rem;
  padding: 1.85rem 2rem;
  background: linear-gradient(135deg, var(--pm-blue-900) 0%, var(--pm-blue-700) 55%, var(--pm-blue-600) 100%);
  box-shadow: 0 16px 40px -20px rgba(10, 30, 74, 0.45);
}
.dash-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.1), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.04), transparent 35%);
  pointer-events: none;
}
.dash-hero__txt, .dash-hero__date { position: relative; z-index: 1; }
.dash-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pm-blue-100);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  margin-bottom: 0.75rem;
}
.dash-hero__badge i, .dash-hero__badge svg { width: 14px; height: 14px; }
.dash-hero__txt h2 {
  font-family: var(--pm-font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.dash-hero__date {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--pm-radius-lg);
  padding: 0.9rem 1.15rem;
  backdrop-filter: blur(4px);
}
.dash-hero__date strong {
  font-family: var(--pm-font-heading);
  font-size: 1.1rem;
}

/* KPI cards */
.stat-card {
  border: 1px solid var(--pm-gray-200);
  border-radius: 1.125rem;
  padding: 1.45rem 1.6rem;
  background: linear-gradient(180deg, #fff 0%, var(--pm-gray-50) 100%);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.stat-card.card--interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--pm-shadow-lg);
  border-color: var(--pm-blue-200);
}
.stat-card:not(.green):not(.gold):not(.red) { border-left: 3px solid var(--pm-blue-500); }
.stat-card.green { border-left: 3px solid var(--pm-green-500); }
.stat-card.gold { border-left: 3px solid var(--pm-gold-500); }
.stat-card.red { border-left: 3px solid var(--pm-red-500); }
.stat-card__icon {
  width: 46px; height: 46px;
  box-shadow: inset 0 0 0 1px rgba(37, 87, 180, 0.06);
}
.kpi-sub {
  font-size: 0.78rem;
  color: var(--pm-gray-500);
  margin-top: 0.35rem;
  line-height: 1.35;
}

/* Page header */
.page-header {
  padding-bottom: var(--pm-gap-md);
  border-bottom: 1px solid var(--pm-gray-200);
}

/* Form cards */
.form-card {
  border-radius: 1.125rem;
  box-shadow: var(--pm-shadow-md);
  border: 1px solid var(--pm-gray-200);
  padding: var(--pm-gap-xl);
  background: var(--pm-white);
}
.form-section__title {
  color: var(--pm-blue-700);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.form-section__title::before {
  content: "";
  width: 3px;
  height: 0.95em;
  background: linear-gradient(180deg, var(--pm-blue-500), var(--pm-blue-300));
  border-radius: 2px;
  flex-shrink: 0;
}
.form-shell__header {
  background: linear-gradient(180deg, var(--pm-gray-50), transparent);
  margin: calc(var(--pm-gap-lg) * -0.25) calc(var(--pm-gap-lg) * -0.25) var(--pm-gap-lg);
  padding: var(--pm-gap-md) var(--pm-gap-lg);
  border-radius: var(--pm-radius-lg);
  border: 1px solid var(--pm-gray-100);
}

/* Tables */
.table-wrap {
  border: 1px solid var(--pm-gray-200);
  background: var(--pm-white);
  overflow: hidden;
}
table tbody tr { transition: background 0.14s ease; }
table tbody tr:last-child td { border-bottom: none; }
table tbody td:first-child:not(:last-child) { font-weight: 500; }
.table-empty {
  padding: 3.5rem 1.5rem;
  background: linear-gradient(180deg, var(--pm-gray-50) 0%, var(--pm-white) 100%);
}
.table-empty__icon {
  width: 68px; height: 68px;
  margin: 0 auto 1rem;
  background: var(--pm-blue-50);
  border: 1px solid var(--pm-blue-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.table-empty__icon i, .table-empty__icon svg {
  width: 28px; height: 28px;
  color: var(--pm-blue-400);
  margin-bottom: 0;
}

/* Badges */
.badge {
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge-green { border-color: rgba(46, 125, 50, 0.12); }
.badge-blue { border-color: rgba(37, 87, 180, 0.12); }
.badge-gold { border-color: rgba(245, 158, 11, 0.15); }
.badge-red { border-color: rgba(229, 57, 53, 0.12); }
.badge-gray { border-color: var(--pm-gray-200); }

/* Dashboard panels */
.dash-panel {
  border-radius: 1.125rem;
  border-color: var(--pm-gray-200);
  box-shadow: var(--pm-shadow-sm);
  transition: box-shadow 0.2s ease;
}
.dash-panel:hover { box-shadow: var(--pm-shadow-md); }
.dash-panel__head {
  background: linear-gradient(180deg, var(--pm-gray-50), var(--pm-white));
}
.dash-panel__head h3 {
  font-family: var(--pm-font-heading);
  font-weight: 700;
  font-size: 0.95rem;
}

/* AI analysis block */
.ai-analysis {
  border-radius: 1.125rem;
  border: 1px solid var(--pm-blue-200);
  padding: var(--pm-gap-lg) var(--pm-gap-xl);
  box-shadow: var(--pm-shadow-sm);
  background: linear-gradient(180deg, var(--pm-blue-50), #fff);
}
.ai-analysis__head h3 {
  font-family: var(--pm-font-heading);
  font-weight: 700;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(180deg, var(--pm-blue-500), var(--pm-blue-600)) !important;
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--pm-blue-600), var(--pm-blue-700)) !important;
  box-shadow: 0 4px 14px rgba(37, 87, 180, 0.28) !important;
}
.btn-green {
  background: linear-gradient(180deg, var(--pm-green-500), var(--pm-green-600)) !important;
}
.btn-icon {
  border-radius: var(--pm-radius-md);
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn-icon:hover {
  transform: scale(1.06);
  box-shadow: var(--pm-shadow-sm);
}

/* Toasts */
.toast {
  border-radius: var(--pm-radius-lg);
  box-shadow: var(--pm-shadow-lg);
  font-weight: 500;
  font-size: 0.875rem;
  min-width: 260px;
}

/* Page transition */
@keyframes pageIn {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}

/* CRUD panels: garantir que a listagem apareça ao trocar de rota */
.page.active [id$="-list-view"]:not(.hidden) {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Detail & social cards */
.detail-card {
  border-radius: 1.125rem;
  box-shadow: var(--pm-shadow-sm);
  border: 1px solid var(--pm-gray-200);
}
.social-settings-card {
  box-shadow: var(--pm-shadow-md);
  border-radius: 1.125rem;
}

/* AI chat layout with page header */
#page-ai-chat .ai-chat-layout {
  height: calc(100vh - 148px);
  min-height: 520px;
}
.ai-chat-main,
.ai-chat-sidebar,
.ai-chat-history {
  border-radius: 1.125rem;
  border: 1px solid var(--pm-gray-200);
  box-shadow: var(--pm-shadow-sm);
}

/* PNTP ring */
.pntp-ring {
  box-shadow: inset 0 0 0 4px var(--pm-white), var(--pm-shadow-sm);
}

/* Content area subtle pattern */
.content {
  background-image: radial-gradient(circle at 50% 0%, rgba(37, 87, 180, 0.03), transparent 55%);
}


/* ==========================================================================
   Design polish v7 — motion, skeleton, dashboard shortcuts
   ========================================================================== */

/* Stat cards entrance */
.stats-grid .stat-card {
  animation: cardIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.04s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.08s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.12s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.16s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.stats-grid.is-loading .stat-num {
  color: transparent;
  background: linear-gradient(90deg, var(--pm-gray-200) 25%, var(--pm-gray-100) 50%, var(--pm-gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--pm-radius-sm);
  min-width: 3rem;
  display: inline-block;
}
.stats-grid.is-loading .kpi-sub {
  color: transparent;
  background: var(--pm-gray-200);
  border-radius: 4px;
  width: 70%;
  height: 0.75rem;
  margin-top: 0.5rem;
}

/* Dashboard quick actions */
.dash-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.dash-quick__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--pm-white);
  border: 1px solid var(--pm-gray-200);
  border-radius: var(--pm-radius-lg);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pm-gray-700);
  text-align: left;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, color 0.18s;
  box-shadow: var(--pm-shadow-sm);
}
.dash-quick__item i, .dash-quick__item svg {
  width: 18px; height: 18px;
  color: var(--pm-blue-500);
  flex-shrink: 0;
}
.dash-quick__item:hover {
  border-color: var(--pm-blue-200);
  box-shadow: var(--pm-shadow-md);
  transform: translateY(-2px);
  color: var(--pm-blue-800);
}

/* Table skeleton */
.skeleton-row td { padding: 1rem 1.65rem; }
.skeleton-cell {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--pm-gray-200) 25%, var(--pm-gray-100) 50%, var(--pm-gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease infinite;
}
.skeleton-cell--sm { width: 60%; margin-left: auto; }
.skeleton-cell--md { width: 85%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Table meta bar */
.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.35rem;
  background: var(--pm-gray-50);
  border-bottom: 1px solid var(--pm-gray-200);
  font-size: 0.78rem;
  color: var(--pm-gray-500);
  font-weight: 500;
}
.table-meta strong { color: var(--pm-blue-700); font-weight: 700; }

/* Sidebar footer */
.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.sidebar-footer small {
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.55);
  letter-spacing: 0.04em;
}
.sidebar.collapsed .sidebar-footer { display: none; }

/* Login footer */
.login-box__footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pm-gray-200);
  font-size: 0.75rem;
  color: var(--pm-gray-400);
  text-align: center;
}

/* Alerts dashboard */
.alert-item {
  border-radius: var(--pm-radius-lg);
  transition: box-shadow 0.18s, transform 0.18s;
}
.alert-item:hover {
  box-shadow: var(--pm-shadow-sm);
  transform: translateX(2px);
}
.alert-item__go {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pm-blue-600);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.alert-item__go:hover { color: var(--pm-blue-800); text-decoration: underline; }

/* PNTP list */
.pntp-li {
  border-radius: var(--pm-radius-md);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.pntp-li[data-page]:hover {
  border-color: var(--pm-blue-200);
  transform: translateX(3px);
}
.pntp-li__ic.ok {
  background: var(--pm-green-100);
  color: var(--pm-green-700);
}
.pntp-li__ic.missing {
  background: var(--pm-red-100);
  color: var(--pm-red-600);
}

/* Distribution bars animate */
.dist-fill {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image uploader premium */
.img-uploader {
  border: 1.5px dashed var(--pm-gray-300);
  border-radius: var(--pm-radius-lg);
  padding: var(--pm-gap-md);
  background: var(--pm-gray-50);
  transition: border-color 0.18s, background 0.18s;
}
.img-uploader:hover {
  border-color: var(--pm-blue-300);
  background: var(--pm-blue-50);
}
.img-uploader-thumb {
  border-radius: var(--pm-radius-md);
  overflow: hidden;
  border: 1px solid var(--pm-gray-200);
  box-shadow: var(--pm-shadow-sm);
}

/* AI modal institutional */
.ai-modal-header {
  background: linear-gradient(135deg, var(--pm-blue-800), var(--pm-blue-600)) !important;
}
.ai-modal {
  border-radius: 1.125rem;
  overflow: hidden;
  border: 1px solid var(--pm-gray-200);
  box-shadow: var(--pm-shadow-lg);
}

/* Focus accessibility */
:focus-visible {
  outline: 2px solid var(--pm-blue-400);
  outline-offset: 2px;
}
.btn:focus-visible, .nav-item:focus-visible {
  outline-offset: 3px;
}

/* Custom scrollbar content */
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb {
  background: var(--pm-gray-300);
  border-radius: 4px;
}
.content::-webkit-scrollbar-thumb:hover { background: var(--pm-gray-400); }

/* Detail AI chat box */
.ai-detail-chat-box {
  border-top: 2px dashed var(--pm-blue-200);
}
.ai-detail-chat-card {
  background: linear-gradient(180deg, var(--pm-blue-50), var(--pm-white));
  border-color: var(--pm-blue-200);
  border-radius: 1.125rem;
}

/* Site blocks grid */
.site-toggle {
  padding: 0.65rem 0.85rem;
  border-radius: var(--pm-radius-md);
  border: 1px solid var(--pm-gray-200);
  background: var(--pm-white);
  transition: border-color 0.15s, background 0.15s;
}
.site-toggle:hover {
  border-color: var(--pm-blue-200);
  background: var(--pm-blue-50);
}


/* ==========================================================================
   Design polish v8 — confirm modal, table search, refinements
   ========================================================================== */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 74, 0.45);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s, visibility 0.22s;
}
.confirm-overlay.active {
  opacity: 1;
  visibility: visible;
}
.confirm-modal {
  background: var(--pm-white);
  border-radius: 1.125rem;
  padding: 1.75rem 1.75rem 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--pm-shadow-lg);
  border: 1px solid var(--pm-gray-200);
  text-align: center;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.confirm-overlay.active .confirm-modal {
  transform: scale(1) translateY(0);
}
.confirm-modal__icon {
  width: 52px; height: 52px;
  margin: 0 auto 1rem;
  background: var(--pm-red-100);
  color: var(--pm-red-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-modal__icon i, .confirm-modal__icon svg { width: 24px; height: 24px; }
.confirm-modal h3 {
  font-family: var(--pm-font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pm-blue-900);
  margin-bottom: 0.5rem;
}
.confirm-modal p {
  font-size: 0.9rem;
  color: var(--pm-gray-600);
  line-height: 1.5;
  margin-bottom: 1.35rem;
}
.confirm-modal__actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
}
.confirm-modal__actions .btn { min-width: 110px; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.35rem;
  background: var(--pm-white);
  border-bottom: 1px solid var(--pm-gray-200);
  flex-wrap: wrap;
}
.table-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  background: var(--pm-gray-50);
  border: 1.5px solid var(--pm-gray-200);
  border-radius: var(--pm-radius-lg);
  padding: 0.45rem 0.85rem;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.table-search:focus-within {
  border-color: var(--pm-blue-400);
  background: var(--pm-white);
  box-shadow: 0 0 0 3px var(--pm-blue-100);
}
.table-search i, .table-search svg {
  width: 16px; height: 16px;
  color: var(--pm-gray-400);
  flex-shrink: 0;
}
.table-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--pm-gray-900);
  width: 100%;
  min-height: auto;
  padding: 0;
}
.table-search input::placeholder { color: var(--pm-gray-400); }

.login-input-wrap {
  position: relative;
}
.login-input-wrap input { padding-right: 2.5rem; }
.login-toggle-pwd {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pm-gray-400);
  padding: 0.25rem;
  display: flex;
  align-items: center;
}
.login-toggle-pwd:hover { color: var(--pm-blue-500); }
.login-toggle-pwd i, .login-toggle-pwd svg { width: 18px; height: 18px; }

.breadcrumb span:not(:last-child) { color: var(--pm-gray-400); }
.breadcrumb span:nth-child(2) { opacity: 0.5; }

.page-header__actions .btn-primary {
  box-shadow: 0 2px 10px rgba(37, 87, 180, 0.2);
}

/* Row highlight on filter match */
tbody tr.row-hidden { display: none !important; }

@media (max-width: 640px) {
  .table-search { max-width: none; width: 100%; }
  .page-header__actions { width: 100%; }
  .page-header__actions .btn { width: 100%; justify-content: center; }
}


/* ==========================================================================
   Design polish v9 — profissional / institucional
   ========================================================================== */

/* Tom mais sóbrio — menos efeitos lúdicos */
.stat-card.card--interactive:hover { transform: translateY(-2px); }
.btn-icon:hover { transform: none; }
.alert-item:hover { transform: none; }
.pntp-li[data-page]:hover { transform: none; }
.dash-quick__item:hover { transform: translateY(-1px); }

.nav-item--featured {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}
.nav-item--featured i, .nav-item--featured svg { color: var(--pm-blue-300) !important; }
.nav-item--featured:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

/* Topbar institucional */
.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pm-gray-600);
  padding: 0.35rem 0.75rem;
  background: var(--pm-gray-50);
  border: 1px solid var(--pm-gray-200);
  border-radius: 999px;
}
.topbar-status__dot {
  width: 7px; height: 7px;
  background: var(--pm-green-500);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
  animation: pulse-dot 2.5s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Breadcrumb profissional */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}
.breadcrumb__sep { color: var(--pm-gray-300); user-select: none; }

/* Tabelas — cabeçalhos ordenáveis */
.th-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.5rem !important;
  transition: color 0.15s, background 0.15s;
}
.th-sortable:hover {
  color: var(--pm-blue-700);
  background: var(--pm-blue-50) !important;
}
.th-sortable::after {
  content: "↕";
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  opacity: 0.35;
  font-weight: 400;
}
.th-sortable--asc::after { content: "↑"; opacity: 0.85; color: var(--pm-blue-600); }
.th-sortable--desc::after { content: "↓"; opacity: 0.85; color: var(--pm-blue-600); }

td code, .cell-mono {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.8rem;
  background: var(--pm-gray-100);
  padding: 0.15rem 0.45rem;
  border-radius: var(--pm-radius-sm);
  border: 1px solid var(--pm-gray-200);
  color: var(--pm-blue-800);
}

.actions-group {
  display: inline-flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

/* Rodapé do painel */
.app-footer {
  margin-top: 2.5rem;
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid var(--pm-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--pm-gray-500);
}
.app-footer strong { color: var(--pm-gray-700); font-weight: 600; }
.app-footer__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: var(--pm-blue-50);
  border: 1px solid var(--pm-blue-100);
  border-radius: 999px;
  color: var(--pm-blue-700);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Login institucional */
.login-box h2 {
  font-family: var(--pm-font-heading);
  letter-spacing: -0.02em;
}
.login-box__subtitle {
  font-size: 0.82rem;
  color: var(--pm-gray-500);
  margin-top: -0.35rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

/* Toast com hierarquia */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-left-width: 4px;
  border-left-style: solid;
}
.toast--success { border-left-color: var(--pm-green-500); }
.toast--error { border-left-color: var(--pm-red-500); }
.toast--info { border-left-color: var(--pm-blue-500); }

/* Formulários — labels consistentes */
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pm-gray-700);
  margin-bottom: 0.35rem;
}

/* Page header mais formal */
.page-header__main p {
  max-width: 52ch;
  line-height: 1.5;
}

/* Dash hero — menos saturado */
.dash-hero {
  background: linear-gradient(135deg, var(--pm-blue-900) 0%, var(--pm-blue-800) 100%) !important;
}

@media (max-width: 768px) {
  .topbar-status span:not(.topbar-status__dot) { display: none; }
  .app-footer { flex-direction: column; align-items: flex-start; }
}


/* ==========================================================================
   Design polish v10 — export, atalhos, feedback
   ========================================================================== */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.table-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.table-kbd-hint {
  font-size: 0.68rem;
  color: var(--pm-gray-400);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.table-kbd-hint kbd {
  font-family: inherit;
  font-size: 0.62rem;
  padding: 0.1rem 0.35rem;
  background: var(--pm-gray-100);
  border: 1px solid var(--pm-gray-300);
  border-radius: 4px;
  color: var(--pm-gray-600);
  font-weight: 600;
}
.btn-icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-only i, .btn-icon-only svg { width: 16px; height: 16px; }

.toast {
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
}
.toast i, .toast svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.toast--success i, .toast--success svg { color: var(--pm-green-600); }
.toast--error i, .toast--error svg { color: var(--pm-red-600); }
.toast--info i, .toast--info svg { color: var(--pm-blue-600); }
.toast span { flex: 1; line-height: 1.35; }

.page-loading-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--pm-blue-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  z-index: 10000;
  pointer-events: none;
}
.page-loading-bar.is-active {
  animation: loadingBar 1.2s ease-in-out infinite;
}
@keyframes loadingBar {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(0.7); transform-origin: left; }
  51% { transform: scaleX(0.7); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.form-group label .req {
  color: var(--pm-red-500);
  font-weight: 700;
  margin-left: 0.1rem;
}

@media (max-width: 768px) {
  .table-kbd-hint { display: none; }
  .table-toolbar__actions .btn span.btn-label { display: none; }
}


/* ==========================================================================
   Design polish v11 — atalhos, busca, loading, login
   ========================================================================== */

.topbar-help-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--pm-gray-200);
  background: rgba(255,255,255,0.85);
  color: var(--pm-gray-600);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.topbar-help-btn:hover {
  background: var(--pm-gray-50);
  border-color: var(--pm-blue-300);
  color: var(--pm-blue-700);
}
.topbar-help-btn i, .topbar-help-btn svg { width: 16px; height: 16px; }

.breadcrumb button.breadcrumb__link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--pm-gray-500);
  cursor: pointer;
  text-decoration: none;
}
.breadcrumb button.breadcrumb__link:hover {
  color: var(--pm-blue-700);
  text-decoration: underline;
}

.table-search { position: relative; }
.table-search__clear {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--pm-gray-200);
  color: var(--pm-gray-600);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.table-search__clear.is-visible { display: inline-flex; }
.table-search__clear:hover { background: var(--pm-gray-300); }
.table-search__clear i, .table-search__clear svg { width: 12px; height: 12px; }
.table-search.has-value input { padding-right: 2rem; }

.shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.shortcuts-overlay.active {
  opacity: 1;
  visibility: visible;
}
.shortcuts-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  width: min(480px, 100%);
  padding: 1.35rem 1.5rem 1.25rem;
  transform: translateY(-8px);
  transition: transform 0.2s;
}
.shortcuts-overlay.active .shortcuts-modal { transform: translateY(0); }
.shortcuts-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.shortcuts-modal__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--pm-gray-900);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.shortcuts-modal__head h3 i, .shortcuts-modal__head h3 svg { width: 18px; height: 18px; color: var(--pm-blue-600); }
.shortcuts-list { list-style: none; margin: 0; padding: 0; }
.shortcuts-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--pm-gray-100);
  font-size: 0.88rem;
  color: var(--pm-gray-700);
}
.shortcuts-list li:last-child { border-bottom: none; }
.shortcuts-list kbd {
  font-family: inherit;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  background: var(--pm-gray-100);
  border: 1px solid var(--pm-gray-300);
  border-radius: 5px;
  color: var(--pm-gray-700);
  font-weight: 600;
  white-space: nowrap;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
  position: relative;
}
.btn.is-loading > i, .btn.is-loading > svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-box .btn-block { min-height: 44px; }

/* ==========================================================================
   Design polish v12 — login responsivo
   ========================================================================== */

.login-overlay {
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: safe center;
  justify-content: safe center;
}

@media (max-width: 640px) {
  .login-overlay {
    padding: 0.75rem;
    align-items: flex-start;
  }
  .login-box {
    max-width: 100%;
    width: 100%;
    margin: 0.5rem auto 1rem;
    padding: 1.75rem 1.25rem 1.35rem;
    border-radius: 1rem;
  }
  .login-logo { margin-bottom: 0.85rem; }
  .login-logo-mark { width: 52px; height: 52px; }
  .login-logo-mark i, .login-logo-mark svg { width: 26px; height: 26px; }
  .login-box h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }
  .login-box p { font-size: 0.8rem; margin-bottom: 1rem; }
  .login-box__subtitle {
    font-size: 0.78rem;
    margin-bottom: 1rem;
    line-height: 1.4;
  }
  .login-box .form-group { margin-bottom: 0.85rem; }
  .login-box .btn-block { width: 100%; }
  .login-box__footer {
    margin-top: 1rem;
    padding-top: 0.85rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 380px) {
  .login-box { padding: 1.35rem 1rem 1.15rem; }
  .login-box h2 { font-size: 1.15rem; }
}

/* Sidebar mini mode — overrides finais */
.sidebar.collapsed .nav-item.active {
  border-left: none !important;
  background: rgba(37, 87, 180, 0.28) !important;
  box-shadow: inset 0 0 0 2px rgba(147, 197, 253, 0.45) !important;
}
.sidebar.collapsed .nav-item--featured {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 auto 0.5rem !important;
  padding: 0 !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  box-shadow: none !important;
}
.sidebar.collapsed .nav-item--featured:hover {
  background: rgba(245, 158, 11, 0.22) !important;
}

/* ==========================================================================
   Login split-screen v23 — estilo Vale Soluções / asteron.digital
   ========================================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(145deg, #eef2f8 0%, #e8edf5 100%);
  overflow: auto;
}

.login-overlay::before,
.login-bg-glow,
.login-bg-glow-2 {
  display: none !important;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  width: min(980px, 100%);
  min-height: min(620px, calc(100vh - 2.5rem));
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(15, 23, 42, 0.06);
}

.login-hero {
  position: relative;
  min-height: 100%;
  color: #fff;
  overflow: hidden;
}

.login-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.login-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(8, 18, 45, 0.88) 0%, rgba(8, 18, 45, 0.55) 48%, rgba(8, 18, 45, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 18, 45, 0.55) 0%, transparent 45%);
}

.login-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.login-hero__eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  max-width: 16rem;
  line-height: 1.45;
}

.login-hero__title {
  margin: 0;
  font-family: var(--pm-font-heading);
  font-size: clamp(2.2rem, 4.5vw, 3.15rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.login-hero__dot {
  color: rgba(255, 255, 255, 0.92);
}

.login-hero__accent {
  color: #ff6b4a;
}

.login-hero__tag {
  margin: 0.65rem 0 1.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.login-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.35rem;
  padding: 0;
  list-style: none;
}

.login-hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
}

.login-hero__stats strong {
  font-family: var(--pm-font-heading);
  font-size: 0.95rem;
  color: #fff;
}

.login-hero__foot {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
}

.login-hero__foot strong {
  color: #fff;
}

.login-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3.5vw, 2.25rem) clamp(1.5rem, 4vw, 2.75rem);
  background: #fff;
}

.login-panel__top {
  margin-bottom: 1.5rem;
}

.login-panel__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.login-panel__logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, var(--pm-blue-600), var(--pm-blue-800));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 87, 180, 0.28);
}

.login-panel__logo-mark i,
.login-panel__logo-mark svg {
  width: 1rem;
  height: 1rem;
}

.login-panel__logo-text {
  font-family: var(--pm-font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pm-blue-900);
  text-transform: lowercase;
}

.login-panel__logo-dot {
  color: #e8472a;
}

.login-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 22rem;
  width: 100%;
  margin: 0 auto;
}

.login-panel__title {
  margin: 0 0 0.35rem;
  font-family: var(--pm-font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.login-panel__sub {
  margin: 0 0 1.65rem;
  font-size: 0.84rem;
  color: var(--pm-gray-500);
  line-height: 1.45;
}

.login-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.login-field input {
  width: 100%;
  padding: 0.82rem 0.95rem;
  border: none;
  border-radius: 0.65rem;
  background: #eef4ff;
  color: #0f172a;
  font-size: 0.92rem;
  font-family: inherit;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.login-field input:focus {
  outline: none;
  background: #e4edff;
  box-shadow: 0 0 0 3px rgba(37, 87, 180, 0.15);
}

.login-panel .login-input-wrap input {
  padding-right: 2.75rem;
}

.login-panel__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.login-forgot {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
}

.btn-login-submit {
  min-width: 7.5rem;
  padding: 0.78rem 1.35rem;
  border: none;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, #ef4428 0%, #d92d20 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(217, 45, 32, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-login-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(217, 45, 32, 0.32);
}

.login-panel__footer {
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--pm-gray-200);
  font-size: 0.74rem;
  color: var(--pm-gray-500);
  text-align: center;
  line-height: 1.45;
}

.login-panel .alert-err {
  margin-bottom: 1rem;
  text-align: left;
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-hero {
    min-height: 220px;
  }

  .login-hero__content {
    justify-content: center;
    padding: 1.5rem;
  }

  .login-hero__stats {
    display: none;
  }

  .login-hero__foot {
    display: none;
  }

  .login-panel__body {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .login-overlay {
    padding: 0.65rem;
  }

  .login-shell {
    border-radius: 1rem;
  }

  .login-panel {
    padding: 1.25rem 1.15rem 1.35rem;
  }

  .login-panel__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .btn-login-submit {
    width: 100%;
  }

  .login-forgot {
    text-align: center;
  }
}

/* ==========================================================================
   Admin v24 — fundo global, shell premium, cards e componentes unificados
   ========================================================================== */

.admin-app {
  font-family: var(--pm-font-body);
  background: var(--pm-surface-muted);
}

.admin-app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    url("/admin/static/images/admin-bg-asteron.png") center center / cover no-repeat fixed;
  pointer-events: none;
}

.admin-app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(248, 250, 253, 0.94) 0%, rgba(241, 245, 252, 0.9) 45%, rgba(248, 250, 253, 0.92) 100%),
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(37, 87, 180, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 95% 10%, rgba(232, 71, 42, 0.04), transparent 50%);
  pointer-events: none;
}

html.auth-session .admin-app::before,
html.auth-session .admin-app::after {
  opacity: 1;
}

.login-overlay {
  background:
    linear-gradient(135deg, rgba(10, 30, 74, 0.55) 0%, rgba(15, 23, 42, 0.45) 100%),
    url("/admin/static/images/admin-bg-asteron.png") center center / cover no-repeat fixed !important;
}

.login-shell {
  box-shadow:
    0 32px 80px rgba(8, 18, 45, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(8, 18, 45, 0.97) 0%, rgba(10, 30, 74, 0.98) 50%, rgba(8, 18, 45, 0.97) 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: 8px 0 32px rgba(8, 18, 45, 0.18) !important;
}

.sidebar-logo-mark {
  background: linear-gradient(145deg, var(--pm-blue-500), var(--pm-blue-700)) !important;
  box-shadow: 0 6px 16px rgba(37, 87, 180, 0.35) !important;
  border-radius: 0.65rem !important;
}

.sidebar-logo-dot {
  color: #ff6b4a;
}

.sidebar-logo-text small {
  color: rgba(148, 163, 184, 0.95) !important;
}

.nav-item {
  border-radius: 0.65rem;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #fff !important;
}

.nav-item.active {
  background: rgba(37, 87, 180, 0.22) !important;
  color: #fff !important;
  border-left: 3px solid #ff6b4a !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.nav-item--featured {
  background: linear-gradient(135deg, var(--pm-blue-600), var(--pm-blue-800)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 20px rgba(10, 30, 74, 0.25) !important;
}

.main {
  background: transparent !important;
}

.topbar {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 20px rgba(10, 30, 74, 0.04) !important;
}

.topbar h1 {
  font-family: var(--pm-font-heading);
  color: var(--pm-blue-900);
  letter-spacing: -0.02em;
}

.topbar-status {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pm-green-700);
}

.content {
  padding: var(--pm-gap-xl) !important;
}

.card {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 1rem !important;
  box-shadow:
    0 1px 2px rgba(10, 30, 74, 0.04),
    0 8px 24px rgba(10, 30, 74, 0.05) !important;
}

.card--interactive:hover,
.stat-card.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 32px rgba(10, 30, 74, 0.1),
    0 0 0 1px rgba(37, 87, 180, 0.08) !important;
  border-color: rgba(37, 87, 180, 0.15) !important;
}

.page-header__main h2 {
  font-family: var(--pm-font-heading);
  color: var(--pm-blue-900);
  letter-spacing: -0.025em;
}

.btn-primary {
  background: linear-gradient(145deg, var(--pm-blue-600), var(--pm-blue-800)) !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(37, 87, 180, 0.25) !important;
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(145deg, var(--pm-blue-500), var(--pm-blue-700)) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 87, 180, 0.3) !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--pm-gray-300);
  color: var(--pm-gray-700);
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--pm-blue-50);
  border-color: var(--pm-blue-200);
  color: var(--pm-blue-700);
}

.form-group input,
.form-group select,
.form-group textarea,
.filter-input,
.ai-detail-chat-input-wrap input {
  border: 1px solid var(--pm-gray-300) !important;
  border-radius: 0.6rem !important;
  background: rgba(255, 255, 255, 0.95) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--pm-blue-400) !important;
  box-shadow: 0 0 0 3px rgba(37, 87, 180, 0.12) !important;
  outline: none;
}

table.data-table thead th {
  background: linear-gradient(180deg, var(--pm-blue-50), #fff);
  color: var(--pm-blue-900);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--pm-blue-100);
}

table.data-table tbody tr:hover {
  background: rgba(37, 87, 180, 0.04);
}

.dash-hero {
  border-radius: 1.125rem;
  box-shadow: 0 20px 48px rgba(10, 30, 74, 0.22);
}

.stat-card {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(6px);
}

.modal-content,
.command-palette__panel {
  border-radius: 1rem !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 24px 64px rgba(10, 30, 74, 0.18) !important;
}

.ai-chat-main,
.ai-chat-history {
  background: rgba(255, 255, 255, 0.92) !important;
}

.ai-chat-header {
  background: linear-gradient(135deg, var(--pm-blue-900), var(--pm-blue-700));
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.user-badge {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  padding: 0.25rem 0.65rem 0.25rem 0.25rem;
}

.user-avatar {
  background: linear-gradient(145deg, var(--pm-blue-500), var(--pm-blue-700)) !important;
}

/* ==========================================================================
   Admin v25 — sidebar e topbar profissionais
   ========================================================================== */

:root {
  --sidebar-width: 272px;
  --sidebar-collapsed-width: 76px;
}

.sidebar {
  width: var(--sidebar-width) !important;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width) !important;
}

.main {
  margin-left: var(--sidebar-width) !important;
}

body.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed-width) !important;
}

.sidebar-logo {
  padding: 1.15rem 1rem !important;
  min-height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-logo-text {
  font-family: var(--pm-font-heading);
  font-size: 0.98rem !important;
  letter-spacing: -0.02em;
}

.sidebar nav {
  padding: 0.65rem 0.65rem 1rem !important;
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.7rem 0.4rem !important;
  margin-top: 0.15rem;
  font-size: 0.62rem !important;
  font-weight: 700;
  letter-spacing: 0.14em !important;
  color: rgba(148, 163, 184, 0.65) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-section:first-of-type {
  border-top: none;
  padding-top: 0.35rem !important;
}

.nav-item {
  gap: 0.7rem !important;
  padding: 0.52rem 0.65rem !important;
  margin-bottom: 0.12rem !important;
  font-size: 0.84rem !important;
  font-weight: 500;
  color: rgba(203, 213, 225, 0.92) !important;
  border-left: 3px solid transparent !important;
  box-shadow: none !important;
}

.nav-item > i,
.nav-item > svg,
.nav-item > .lucide {
  width: 18px !important;
  height: 18px !important;
  padding: 0.45rem !important;
  box-sizing: content-box;
  border-radius: 0.55rem !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(148, 163, 184, 0.95) !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

.nav-item:hover > i,
.nav-item:hover > svg,
.nav-item:hover > .lucide {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.nav-item.active {
  background: rgba(37, 87, 180, 0.18) !important;
  color: #fff !important;
  border-left-color: #ff6b4a !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

.nav-item.active > i,
.nav-item.active > svg,
.nav-item.active > .lucide {
  background: rgba(255, 107, 74, 0.18) !important;
  color: #ffb4a2 !important;
}

.nav-item--featured {
  margin: 0 0.15rem 0.85rem !important;
  padding: 0.62rem 0.75rem !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
}

.nav-item--featured > i,
.nav-item--featured > svg {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

.sidebar-footer {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem !important;
  background: rgba(0, 0, 0, 0.12);
}

.sidebar-footer__badge {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer small {
  font-size: 0.68rem !important;
  color: rgba(148, 163, 184, 0.75) !important;
}

/* Topbar */
.topbar {
  min-height: 64px;
  padding: 0.65rem 1.5rem !important;
  gap: 1rem !important;
}

.topbar-left {
  min-width: 0;
  flex: 1;
}

.topbar-title {
  gap: 0.15rem !important;
  min-width: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pm-gray-500);
  margin: 0;
}

.breadcrumb__sep {
  color: var(--pm-gray-400);
  opacity: 0.7;
}

.breadcrumb strong {
  color: var(--pm-blue-600);
  font-weight: 700;
}

.topbar-heading {
  margin: 0;
  font-family: var(--pm-font-heading);
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: var(--pm-blue-900) !important;
  letter-spacing: -0.025em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  gap: 0.75rem !important;
  flex-shrink: 0;
}

.topbar-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.topbar-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0 0.65rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--pm-gray-600);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.topbar-tool-btn:hover {
  background: #fff;
  color: var(--pm-blue-700);
  box-shadow: 0 2px 8px rgba(10, 30, 74, 0.06);
}

.topbar-tool-btn i,
.topbar-tool-btn svg {
  width: 16px;
  height: 16px;
}

.topbar-cmd-btn__hint {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--pm-gray-500);
}

.topbar-status {
  margin-left: 0.15rem;
  padding: 0.35rem 0.65rem !important;
  font-size: 0.72rem !important;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(15, 23, 42, 0.1);
  flex-shrink: 0;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.user-badge {
  gap: 0.55rem !important;
  padding: 0.28rem 0.75rem 0.28rem 0.28rem !important;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.15;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pm-gray-800);
  white-space: nowrap;
}

.user-name .badge,
.user-name .user-role {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.62rem;
}

.topbar-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.6rem;
  background: #fff;
  color: var(--pm-gray-700);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.topbar-logout-btn:hover {
  border-color: rgba(229, 57, 53, 0.25);
  color: var(--pm-red-600);
  background: #fff5f5;
}

@media (max-width: 900px) {
  .topbar-cmd-btn__hint,
  .topbar-logout-btn span {
    display: none;
  }

  .topbar-heading {
    font-size: 1rem !important;
  }

  .topbar-divider {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar-status span:not(.topbar-status__dot) {
    display: none;
  }

  .user-meta {
    display: none;
  }
}

/* ==========================================================================
   Admin v26 — UI premium avançada (dashboard, cards, tabelas, IA, motion)
   ========================================================================== */

.admin-main {
  position: relative;
}

.page {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.page.active {
  display: block !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto;
  visibility: visible !important;
}

.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 10000;
  background: linear-gradient(90deg, var(--pm-blue-500), #ff6b4a, var(--pm-gold-500));
  box-shadow: 0 0 12px rgba(37, 87, 180, 0.45);
  transition: width 0.35s ease;
}

.page-loading-bar.is-active {
  width: 72%;
  animation: adminLoadPulse 1.2s ease-in-out infinite alternate;
}

@keyframes adminLoadPulse {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

/* Dashboard hero premium */
.dash-hero--premium {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 56px rgba(10, 30, 74, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

.dash-hero--premium::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.22), transparent 68%);
  pointer-events: none;
}

.dash-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}

.dash-chip i,
.dash-chip svg {
  width: 13px;
  height: 13px;
}

.dash-hero__date {
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

/* KPI cards avançados */
.stats-grid {
  gap: 1.15rem !important;
}

.stat-card {
  border-radius: 1rem !important;
  padding: 1.35rem 1.45rem !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(15, 23, 42, 0.07) !important;
  box-shadow:
    0 1px 2px rgba(10, 30, 74, 0.04),
    0 10px 28px rgba(10, 30, 74, 0.06) !important;
}

.stat-card.card--interactive:hover {
  transform: translateY(-4px) !important;
  box-shadow:
    0 16px 40px rgba(10, 30, 74, 0.12),
    0 0 0 1px rgba(37, 87, 180, 0.08) !important;
}

.stat-card__icon {
  width: 2.65rem !important;
  height: 2.65rem !important;
  border-radius: 0.75rem !important;
  background: linear-gradient(145deg, var(--pm-blue-50), #fff) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stat-num {
  font-family: var(--pm-font-heading);
  font-size: 2.15rem !important;
  background: linear-gradient(135deg, var(--pm-blue-900), var(--pm-blue-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-card.green .stat-num {
  background: linear-gradient(135deg, var(--pm-green-700), var(--pm-green-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-card.gold .stat-num {
  background: linear-gradient(135deg, #b45309, var(--pm-gold-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-card.red .stat-num {
  background: linear-gradient(135deg, var(--pm-red-600), #f87171);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kpi-sub {
  font-size: 0.74rem;
  color: var(--pm-gray-500);
  margin-top: 0.35rem;
}

/* Ações rápidas bento */
.dash-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.dash-quick__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  color: var(--pm-gray-800);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 14px rgba(10, 30, 74, 0.04);
}

.dash-quick__item:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 87, 180, 0.2);
  background: #fff;
  box-shadow: 0 10px 24px rgba(10, 30, 74, 0.08);
  color: var(--pm-blue-700);
}

.dash-quick__item i,
.dash-quick__item svg {
  width: 16px;
  height: 16px;
  color: var(--pm-blue-600);
}

/* Painéis dashboard + PNTP */
.dash-grid {
  gap: 1.15rem !important;
}

.dash-panel {
  border-radius: 1rem !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 8px 24px rgba(10, 30, 74, 0.05) !important;
  overflow: hidden;
}

.dash-panel__head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.9), rgba(255, 255, 255, 0.4));
}

.dash-panel__head h3 {
  font-family: var(--pm-font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pm-blue-900);
}

.pntp-ring {
  box-shadow:
    0 0 0 6px rgba(37, 87, 180, 0.08),
    0 12px 28px rgba(37, 87, 180, 0.15);
}

/* Análise IA */
.ai-analysis {
  border-radius: 1rem;
  padding: 1.35rem 1.45rem;
  margin-bottom: 1.75rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 245, 255, 0.92));
  border: 1px solid rgba(37, 87, 180, 0.12);
  box-shadow:
    0 12px 32px rgba(10, 30, 74, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.ai-analysis::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pm-blue-500), #ff6b4a);
}

.ai-analysis__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.ai-analysis__head h3 {
  font-family: var(--pm-font-heading);
  font-size: 1.05rem;
  color: var(--pm-blue-900);
}

.ai-analysis__out {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.06);
  max-height: 420px;
  overflow-y: auto;
  line-height: 1.55;
  font-size: 0.88rem;
}

/* Tabelas */
.table-wrap {
  border-radius: 1rem !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 8px 24px rgba(10, 30, 74, 0.05) !important;
  overflow: hidden;
}

.table-toolbar {
  padding: 0.85rem 1rem !important;
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.95), rgba(255, 255, 255, 0.6));
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.table-search {
  background: #fff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 0.65rem !important;
  box-shadow: inset 0 1px 2px rgba(10, 30, 74, 0.03);
}

table.data-table tbody tr {
  transition: background 0.15s ease;
}

table.data-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 253, 0.65);
}

/* Formulários / page header */
.page-header {
  padding: 0.25rem 0 1.15rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 1.25rem !important;
}

.page-header__main h2 {
  font-size: 1.35rem !important;
}

/* Chat IA layout */
.ai-chat-layout {
  gap: 1rem !important;
}

.ai-chat-main {
  border-radius: 1rem !important;
  overflow: hidden;
  border: 1px solid rgba(37, 87, 180, 0.1) !important;
}

.ai-chat-history,
.ai-chat-sidebar {
  border-radius: 1rem !important;
}

.ai-chat-input-bar {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #fff, var(--pm-blue-50));
  padding: 0.85rem !important;
}

.ai-chat-input-bar textarea {
  border-radius: 0.75rem !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: #fff !important;
  resize: vertical;
  min-height: 2.75rem;
}

.ai-shortcut-btn {
  justify-content: flex-start !important;
  text-align: left;
  border-radius: 0.65rem !important;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ai-shortcut-btn:hover {
  transform: translateX(3px);
  border-color: var(--pm-blue-200) !important;
  background: var(--pm-blue-50) !important;
}

/* Modais */
.modal-overlay.active,
.ai-modal-overlay.active {
  backdrop-filter: blur(8px);
}

.modal-content {
  animation: adminModalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes adminModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Badges & toasts */
.badge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.toast {
  border-radius: 0.75rem !important;
  box-shadow: 0 12px 32px rgba(10, 30, 74, 0.15) !important;
  backdrop-filter: blur(8px);
}

/* Footer app */
.app-footer {
  margin-top: auto;
  padding: 1rem 0 0.5rem;
  font-size: 0.74rem;
  color: var(--pm-gray-500);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .page,
  .dash-quick__item,
  .stat-card,
  .modal-content {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   Admin v27 — design interno unificado (forms, modais, listas, IA)
   ========================================================================== */

:root {
  --admin-surface: rgba(255, 255, 255, 0.92);
  --admin-surface-strong: rgba(255, 255, 255, 0.97);
  --admin-border: rgba(15, 23, 42, 0.08);
  --admin-border-soft: rgba(15, 23, 42, 0.06);
  --admin-shadow-panel: 0 8px 28px rgba(10, 30, 74, 0.06);
  --admin-shadow-float: 0 16px 48px rgba(10, 30, 74, 0.12);
  --admin-radius-panel: 1rem;
  --admin-radius-input: 0.65rem;
  --admin-focus-ring: 0 0 0 3px rgba(37, 87, 180, 0.14);
}

/* Corrigir sombras roxas legadas */
.btn-primary {
  background: linear-gradient(135deg, var(--pm-blue-600), var(--pm-blue-500)) !important;
  box-shadow: 0 4px 14px rgba(37, 87, 180, 0.22) !important;
}
.btn-primary:hover {
  box-shadow: 0 8px 22px rgba(37, 87, 180, 0.28) !important;
}

.dash-hero:not(.dash-hero--premium) {
  background: linear-gradient(135deg, var(--pm-blue-900) 0%, var(--pm-blue-700) 55%, var(--pm-blue-600) 100%) !important;
  box-shadow: 0 20px 40px -22px rgba(10, 30, 74, 0.45) !important;
}

.ai-analysis__out .aia-h::before {
  background: linear-gradient(135deg, var(--pm-blue-500), var(--pm-blue-400)) !important;
}

/* Área de conteúdo */
.admin-content {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-height, 64px));
  gap: 0.25rem;
}

.admin-content .page {
  animation: adminPageIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes adminPageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.admin-content::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.ai-chat-messages::-webkit-scrollbar,
.ai-analysis__out::-webkit-scrollbar,
.cmd-palette__list::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.admin-content::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.ai-chat-messages::-webkit-scrollbar-thumb,
.ai-analysis__out::-webkit-scrollbar-thumb,
.cmd-palette__list::-webkit-scrollbar-thumb {
  background: rgba(37, 87, 180, 0.22);
  border-radius: 99px;
}
.admin-content::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 87, 180, 0.38);
}

/* Page headers internos */
.admin-content .page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.15rem 0 1.1rem;
  margin-bottom: 1.35rem !important;
  border-bottom: 1px solid var(--admin-border-soft);
}

.admin-content .page-header__main h2 {
  font-family: var(--pm-font-heading);
  font-size: 1.42rem !important;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--pm-blue-900);
  line-height: 1.2;
}

.admin-content .page-header__main p {
  font-size: 0.84rem;
  color: var(--pm-gray-500);
  margin-top: 0.35rem;
  max-width: 42rem;
  line-height: 1.45;
}

.admin-content .page-header__actions {
  gap: 0.55rem;
}

/* Cards genéricos */
.admin-content .card,
.admin-content .form-card {
  background: var(--admin-surface-strong) !important;
  border: 1px solid var(--admin-border) !important;
  border-radius: var(--admin-radius-panel) !important;
  box-shadow: var(--admin-shadow-panel) !important;
  backdrop-filter: blur(8px);
}

.admin-content .card {
  padding: 1.25rem 1.35rem;
}

/* Formulários */
.admin-content .form-shell,
.admin-content .form-card {
  max-width: 920px;
  margin: 0 auto;
}

.admin-content .form-card {
  padding: 1.5rem 1.65rem 1.35rem !important;
}

.admin-content .form-shell__header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: -0.25rem 0 1.35rem;
  padding: 1rem 1.15rem;
  border-radius: 0.85rem;
  border: 1px solid var(--admin-border-soft);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.95), rgba(255, 255, 255, 0.5));
}

.admin-content .form-shell__header h2 {
  font-family: var(--pm-font-heading);
  font-size: 1.2rem !important;
  font-weight: 700;
  color: var(--pm-blue-900);
  flex: 1;
  margin: 0;
}

.admin-content .form-section {
  margin-bottom: 1.35rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--admin-border-soft);
}

.admin-content .form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0.75rem;
  padding-bottom: 0;
}

.admin-content .form-section__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--pm-blue-700);
  margin-bottom: 1rem;
}

.admin-content .form-section__title::before {
  content: "";
  width: 3px;
  height: 0.95em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--pm-blue-500), #ff6b4a);
  flex-shrink: 0;
}

.admin-content .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem 1.35rem;
}

.admin-content .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.admin-content .form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pm-gray-700);
  letter-spacing: 0.01em;
}

.admin-content .form-group .text-muted,
.admin-content .form-group small {
  font-size: 0.74rem;
  color: var(--pm-gray-500);
  line-height: 1.35;
}

.admin-content .form-group input,
.admin-content .form-group select,
.admin-content .form-group textarea,
.admin-content .ai-modal-select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.62rem 0.85rem;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--pm-gray-800);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--admin-radius-input);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: inset 0 1px 2px rgba(10, 30, 74, 0.03);
}

.admin-content .form-group textarea {
  min-height: 6.5rem;
  resize: vertical;
  line-height: 1.45;
}

.admin-content .form-group input:hover,
.admin-content .form-group select:hover,
.admin-content .form-group textarea:hover {
  border-color: rgba(37, 87, 180, 0.28);
}

.admin-content .form-group input:focus,
.admin-content .form-group select:focus,
.admin-content .form-group textarea:focus,
.admin-content .ai-modal-select:focus {
  outline: none;
  border-color: var(--pm-blue-400) !important;
  box-shadow: var(--admin-focus-ring), inset 0 1px 2px rgba(10, 30, 74, 0.02) !important;
}

.admin-content .form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding: 1rem 0 0.35rem;
  border-top: 1px solid var(--admin-border-soft);
  background: linear-gradient(180deg, transparent, rgba(248, 250, 253, 0.6));
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.admin-content .file-uploader-row {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px dashed rgba(37, 87, 180, 0.22);
  background: rgba(240, 245, 255, 0.45);
}

.admin-content .site-toggle {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid var(--admin-border);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-content .site-toggle:hover {
  border-color: rgba(37, 87, 180, 0.25);
  background: var(--pm-blue-50);
}

.admin-content .site-toggle:has(input:checked) {
  background: linear-gradient(135deg, var(--pm-blue-50), #fff);
  border-color: rgba(37, 87, 180, 0.35);
  box-shadow: inset 0 0 0 1px rgba(37, 87, 180, 0.08);
}

/* Botões internos */
.admin-content .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  border-radius: 0.65rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.admin-content .btn-secondary {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--pm-gray-700);
}

.admin-content .btn-secondary:hover {
  background: var(--pm-gray-50);
  border-color: rgba(37, 87, 180, 0.22);
  color: var(--pm-blue-700);
}

.admin-content .btn-danger {
  background: linear-gradient(135deg, #dc2626, var(--pm-red-500));
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.2);
}

.admin-content .btn-icon {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border-radius: 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: var(--pm-gray-600);
}

.admin-content .btn-icon:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 87, 180, 0.25);
  background: var(--pm-blue-50);
  color: var(--pm-blue-600);
}

.admin-content .btn-icon--danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--pm-red-600);
}

.admin-content .btn-icon--edit:hover {
  background: #fffbeb;
  border-color: #fde68a;
  color: var(--pm-gold-600);
}

.btn-ia-inline {
  background: linear-gradient(135deg, var(--pm-blue-700), var(--pm-blue-500)) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(37, 87, 180, 0.25) !important;
}

.btn-ia-inline:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Tabelas e listagens */
.admin-content .table-wrap {
  border-radius: var(--admin-radius-panel) !important;
  border: 1px solid var(--admin-border) !important;
  background: var(--admin-surface-strong) !important;
  box-shadow: var(--admin-shadow-panel) !important;
  overflow: hidden;
}

.admin-content .table-toolbar {
  padding: 0.9rem 1.05rem !important;
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.98), rgba(255, 255, 255, 0.75));
  border-bottom: 1px solid var(--admin-border-soft);
  gap: 0.65rem;
}

.admin-content .table-search {
  min-height: 2.5rem;
  padding: 0.45rem 0.85rem !important;
  font-size: 0.86rem;
}

.admin-content table.data-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pm-gray-600);
  background: rgba(248, 250, 253, 0.95);
  border-bottom: 1px solid var(--admin-border-soft);
  padding: 0.75rem 1rem;
}

.admin-content table.data-table tbody td {
  padding: 0.72rem 1rem;
  font-size: 0.86rem;
  color: var(--pm-gray-800);
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  vertical-align: middle;
}

.admin-content table.data-table tbody tr:hover {
  background: rgba(240, 245, 255, 0.65) !important;
}

.admin-content .table-empty {
  padding: 3.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.8), #fff);
}

.admin-content .table-empty__icon {
  width: 4.25rem;
  height: 4.25rem;
  background: linear-gradient(145deg, var(--pm-blue-50), #fff);
  border: 1px solid rgba(37, 87, 180, 0.12);
}

/* Badges */
.admin-content .badge,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.26rem 0.68rem;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-green, .badge--success { background: #ecfdf3; color: #15803d; border-color: rgba(21, 128, 61, 0.15); }
.badge-blue, .badge--info { background: var(--pm-blue-50); color: var(--pm-blue-700); border-color: rgba(37, 87, 180, 0.15); }
.badge-gold, .badge--warning { background: #fffbeb; color: #b45309; border-color: rgba(180, 83, 9, 0.15); }
.badge-red, .badge--danger { background: #fef2f2; color: #b91c1c; border-color: rgba(185, 28, 28, 0.15); }
.badge-gray, .badge--neutral { background: var(--pm-gray-100); color: var(--pm-gray-700); border-color: rgba(15, 23, 42, 0.08); }

/* Modais IA e genéricos */
.ai-modal-header,
.modal-header {
  background: linear-gradient(135deg, var(--pm-blue-900) 0%, var(--pm-blue-700) 100%) !important;
  color: #fff !important;
  padding: 1.1rem 1.35rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-modal-header h3,
.modal-header h3 {
  font-family: var(--pm-font-heading);
  font-size: 1.05rem !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ai-modal {
  border-radius: 1rem !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: var(--admin-shadow-float) !important;
  overflow: hidden;
}

.ai-modal-body {
  padding: 1.35rem 1.45rem !important;
  background: linear-gradient(180deg, #fff, rgba(248, 250, 253, 0.5));
}

.ai-modal-footer {
  padding: 0.9rem 1.35rem !important;
  background: rgba(248, 250, 253, 0.95) !important;
  border-top: 1px solid var(--admin-border-soft) !important;
}

.ai-modal-select:focus {
  border-color: var(--pm-blue-400) !important;
  box-shadow: var(--admin-focus-ring) !important;
}

.ai-context-preview {
  border-radius: 0.65rem;
  background: #fff;
  border: 1px solid var(--admin-border);
  font-size: 0.78rem;
  line-height: 1.45;
}

.ai-preview-container {
  border-radius: 0.75rem;
  border: 1px solid var(--admin-border);
  overflow: hidden;
}

.ai-preview-box textarea {
  border: none !important;
  border-radius: 0 !important;
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Command palette */
.cmd-palette {
  border-radius: 1rem !important;
  border: 1px solid var(--admin-border) !important;
  box-shadow: 0 24px 80px rgba(10, 30, 74, 0.22) !important;
  overflow: hidden;
}

.cmd-palette__search {
  padding: 0.95rem 1.05rem !important;
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.95), #fff);
}

.cmd-palette__search input {
  font-size: 0.95rem;
  font-weight: 500;
}

.cmd-palette__item {
  border-radius: 0.65rem !important;
  padding: 0.7rem 0.8rem !important;
  transition: background 0.12s ease, transform 0.12s ease;
}

.cmd-palette__item.is-active,
.cmd-palette__item:hover {
  background: linear-gradient(90deg, var(--pm-blue-50), rgba(255, 255, 255, 0.9)) !important;
  transform: translateX(2px);
}

/* Chat IA */
.ai-chat-layout {
  align-items: stretch;
}

.ai-chat-history,
.ai-chat-main,
.ai-chat-sidebar {
  border: 1px solid rgba(37, 87, 180, 0.1) !important;
  box-shadow: var(--admin-shadow-panel) !important;
}

.ai-chat-history__head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--admin-border-soft);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.95), #fff);
}

.ai-chat-history__btn {
  border-radius: 0.6rem;
  transition: background 0.12s ease;
}

.ai-chat-history__item.is-active {
  background: linear-gradient(90deg, var(--pm-blue-50), transparent);
  border-left: 3px solid var(--pm-blue-500);
}

.ai-chat-header {
  background: linear-gradient(135deg, var(--pm-blue-900), var(--pm-blue-600)) !important;
  padding: 0.85rem 1.15rem !important;
}

.ai-chat-messages {
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.65), rgba(255, 255, 255, 0.9)) !important;
  padding: 1.15rem 1.25rem !important;
}

.ai-msg__bubble {
  border-radius: 0.85rem !important;
  padding: 0.72rem 0.95rem !important;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(10, 30, 74, 0.04);
}

.ai-msg--user .ai-msg__bubble {
  background: linear-gradient(135deg, var(--pm-blue-600), var(--pm-blue-500)) !important;
  color: #fff !important;
  border-bottom-right-radius: 0.25rem !important;
}

.ai-msg--bot .ai-msg__bubble {
  background: #fff !important;
  border: 1px solid var(--admin-border) !important;
  border-bottom-left-radius: 0.25rem !important;
}

.ai-msg__avatar {
  width: 1.85rem !important;
  height: 1.85rem !important;
  border-radius: 0.55rem !important;
}

.ai-doc-upload {
  border-top: 1px solid var(--admin-border-soft);
  background: rgba(248, 250, 253, 0.6);
}

.ai-doc-upload__panel {
  padding: 1rem 1.15rem;
}

.ai-doc-upload__grid {
  gap: 0.85rem;
}

.ai-doc-upload__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pm-gray-700);
}

/* Galeria admin */
.gallery-admin-grid {
  gap: 1rem !important;
}

.gallery-admin-card {
  border-radius: 0.85rem !important;
  border: 1px solid var(--admin-border) !important;
  background: var(--admin-surface-strong) !important;
  box-shadow: var(--admin-shadow-panel) !important;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gallery-admin-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--admin-shadow-float) !important;
}

.gallery-admin-card__thumb {
  background: var(--pm-gray-100);
  aspect-ratio: 4/3;
}

.gallery-preview-item {
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid var(--admin-border);
}

/* Alertas dashboard */
.alert-item {
  border-radius: 0.75rem !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.alert-item:hover {
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(10, 30, 74, 0.06);
}

.alert-item__go {
  font-weight: 700;
  border-radius: 0.35rem;
  padding: 0.15rem 0.35rem;
}

/* Footer */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding: 1rem 0 0.25rem;
  font-size: 0.74rem;
  color: var(--pm-gray-500);
  border-top: 1px solid var(--admin-border-soft);
}

.app-footer__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--pm-blue-50);
  border: 1px solid rgba(37, 87, 180, 0.12);
  color: var(--pm-blue-700);
  font-weight: 600;
  font-size: 0.7rem;
}

/* Responsivo forms */
@media (max-width: 768px) {
  .admin-content .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-content .form-card {
    padding: 1.15rem !important;
  }

  .admin-content .page-header {
    flex-direction: column;
  }

  .admin-content .form-footer {
    justify-content: stretch;
  }

  .admin-content .form-footer .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-content .page,
  .gallery-admin-card,
  .alert-item,
  .cmd-palette__item {
    animation: none !important;
    transition: none !important;
  }
}
