/* --------------------------------------
   Investech Core - Style
   Tema: Futurista calmo (dark-first)
-----------------------------------------*/

/* Tokens base */
:root {
  --color-bg: #050711;
  --color-bg-elevated: #0b0e1a;
  --color-bg-elevated-soft: #0d1223;
  --color-surface-subtle: rgba(255,255,255,0.02);

  --color-border-subtle: rgba(255,255,255,0.06);
  --color-border-strong: rgba(255,255,255,0.16);

  --color-text: #f5f7ff;
  --color-text-soft: #a7b3d9;
  --color-text-muted: #6d7590;
  --color-text-invert: #050711;

  --color-accent: #5af2d6;
  --color-accent-soft: rgba(90,242,214,0.12);
  --color-accent-strong: #46d8c0;
  --color-accent-alt: #7b7cff;
  --color-danger: #ff5577;
  --color-danger-soft: rgba(255,85,119,0.16);
  --color-warning: #ffc857;
  --color-success: #33d69f;

  --shadow-soft: 0 18px 40px rgba(0,0,0,0.7);
  --shadow-inner: inset 0 0 0 1px rgba(255,255,255,0.04);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    Segoe UI, Roboto, sans-serif;

  --transition-fast: 120ms ease-out;
  --transition-med: 200ms ease-out;

  --focus-ring: 0 0 0 1px rgba(90,242,214,0.9), 0 0 0 4px rgba(90,242,214,0.3);

  --density-scale: 1;
}

/* Tema escuro forçado (light desativado para manter UI legível) */
html[data-theme="light"] {
  --color-bg: #050711;
  --color-bg-elevated: #0b0e1a;
  --color-bg-elevated-soft: #0d1223;
  --color-surface-subtle: rgba(255,255,255,0.02);
  --color-border-subtle: rgba(255,255,255,0.06);
  --color-border-strong: rgba(255,255,255,0.16);
  --color-text: #f5f7ff;
  --color-text-soft: #a7b3d9;
  --color-text-muted: #6d7590;
  --color-text-invert: #050711;
  --color-accent-soft: rgba(90,242,214,0.12);
  --shadow-soft: 0 18px 40px rgba(0,0,0,0.7);
}

/* Densidade */
html[data-density="compact"] {
  --density-scale: 0.9;
}
html[data-density="comfortable"] {
  --density-scale: 1.05;
}

/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 0 0,#131732 0,#050711 40%,#02030a 100%);
  color: #f5f7ff;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

/* Força inputs/select/textarea sempre escuros (evita fundo claro do browser) */
input,
select,
textarea,
.field-input {
  color-scheme: dark;
  background-color: #0d1223 !important;
  color: #f5f7ff !important;
  border-color: rgba(255,255,255,0.12) !important;
}
input::placeholder,
textarea::placeholder {
  color: #6d7590 !important;
}
select option {
  background: #0b0e1a;
  color: #f5f7ff;
}

/* Foco visível */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 999px;
}

/* Scrollbars discretos */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(140,155,215,0.5) transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(140,155,215,0.5);
  border-radius: 999px;
}

/* Layouts de shell */
.shell {
  width: 100%;
  height: 100vh;
  display: flex;
  transition: opacity var(--transition-med), transform var(--transition-med);
}

.shell.is-hidden {
  display: none;
}

/* ------------------------------
   Auth
---------------------------------*/
.auth-shell {
  padding: var(--space-2xl);
  gap: var(--space-2xl);
}

@media (max-width: 960px) {
  .auth-shell {
    flex-direction: column;
    padding: var(--space-xl);
  }
}

.auth-hero {
  flex: 1.1;
  border-radius: 32px;
  background: radial-gradient(circle at 0 0,rgba(90,242,214,0.2),transparent 40%),
              radial-gradient(circle at 100% 100%,rgba(123,124,255,0.2),transparent 40%),
              linear-gradient(145deg,#080c20,#050711);
  box-shadow: var(--shadow-soft);
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,0.04);
}

.auth-hero-logo {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 16px;
  background: rgba(3,5,20,0.7);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.logo-mark.small {
  border-radius: 12px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}
.logo-title {
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--color-accent);
}
.logo-subtitle {
  font-size: 11px;
  color: rgba(205,215,245,0.8);
}

.auth-hero-copy h1 {
  font-size: clamp(32px, 3.2vw, 40px);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-md);
}
.auth-hero-copy p {
  max-width: 420px;
  color: var(--color-text-soft);
  margin-bottom: var(--space-xl);
}
.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}
.auth-points li {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: radial-gradient(circle at 0 0,rgba(90,242,214,0.14),transparent 50%);
  color: var(--color-text-soft);
  font-size: 13px;
}

/* Painel Auth */
.auth-panel {
  flex: 0.9;
  border-radius: 32px;
  background: #0b0e1a;
  padding: var(--space-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
}

.auth-tabs {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.02);
  align-self: flex-start;
  margin-bottom: var(--space-xl);
}
.auth-tab {
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition-med), color var(--transition-med);
}
.auth-tab.is-active {
  background: rgba(90,242,214,0.1);
  color: var(--color-accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
}
.auth-form.is-hidden {
  display: none;
}

.auth-section-header h2 {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 600;
  color: #f5f7ff;
  letter-spacing: 0.02em;
}
.auth-section-header p {
  margin: 0 0 var(--space-lg) 0;
  color: #a7b3d9;
  font-size: 13px;
  line-height: 1.45;
}

/* Campos */
.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #b8c2e0;
  letter-spacing: 0.02em;
}
.field-input {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0d1223;
  padding: calc(10px * var(--density-scale)) calc(16px * var(--density-scale));
  font-size: 14px;
  color: #f5f7ff;
  outline: none;
  transition: border var(--transition-med), box-shadow var(--transition-med),
              background var(--transition-med), transform var(--transition-fast);
}
.field-input::placeholder {
  color: #6d7590;
}
.field-input:hover {
  border-color: rgba(255,255,255,0.18);
}
.field-input:focus {
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
  transform: translateY(-0.5px);
  background: #0b0e1a;
}
.field-input:focus-visible {
  box-shadow: var(--focus-ring);
  border-color: var(--color-accent);
  transform: translateY(-0.5px);
  background: #0b0e1a;
}

/* Checkbox */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #a7b3d9;
}

/* Botões */
.btn {
  border-radius: 999px;
  border: none;
  padding: calc(9px * var(--density-scale)) calc(18px * var(--density-scale));
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-med), color var(--transition-med),
              border var(--transition-med), opacity var(--transition-fast);
}
.btn.primary {
  background: linear-gradient(135deg,#5af2d6,#7b7cff);
  color: #050711;
  box-shadow: 0 14px 32px rgba(5,10,30,0.65);
}
.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(5,10,30,0.8);
}
.btn.secondary {
  background: rgba(133,147,215,0.2);
  color: var(--color-text);
  border: 1px solid rgba(141,159,230,0.65);
}
.btn.ghost {
  background: transparent;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border-subtle);
}
.btn.danger {
  background: var(--color-danger);
  color: var(--color-text-invert);
}
.btn[disabled],
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Botão link */
.link-button {
  border: none;
  background: none;
  color: var(--color-text-soft);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}
.link-button.small {
  font-size: 11px;
}

/* Ícone button */
.icon-button {
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.02);
  color: var(--color-text-soft);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
              border var(--transition-fast), transform var(--transition-fast);
}
.icon-button:hover {
  background: rgba(255,255,255,0.04);
  color: var(--color-accent);
}
.icon-button i {
  font-size: 14px;
}
.icon-button:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Auth layout */
.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-actions {
  margin-top: var(--space-lg);
  display: flex;
  gap: var(--space-md);
}

.auth-inline-alert {
  margin-top: var(--space-md);
  font-size: 12px;
  color: #ff5577;
}

/* Select/input desabilitado mantém aparência escura */
select.field-input:disabled,
input:disabled {
  opacity: 0.85;
  cursor: not-allowed;
  background-color: #0a0c16 !important;
}

/* ------------------------------
   App shell
---------------------------------*/
.app-shell {
  flex-direction: column;
}

.topbar {
  height: 56px;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg,rgba(10,15,40,0.96),rgba(5,7,17,0.98));
  border-bottom: 1px solid rgba(255,255,255,0.03);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.topbar-logo-text {
  display: flex;
  flex-direction: column;
}
.brand-main {
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-soft);
}
.brand-sub {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Busca global */
.topbar-search {
  position: relative;
  min-width: 220px;
  max-width: 360px;
  flex: 1;
}
.input-with-icon {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}
.field-input.compact {
  padding-left: 30px;
  font-size: 13px;
}

/* Dropdown de busca */
.search-dropdown {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  background: #0b0e1a;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-soft);
  padding: 4px;
  display: none;
  max-height: 260px;
  overflow: auto;
  z-index: 25;
}
.search-dropdown.is-visible {
  display: block;
}
.search-result-item {
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.search-result-item:hover {
  background: rgba(90,242,214,0.08);
}
.search-result-title {
  font-size: 13px;
}
.search-result-meta {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Notificações */
.notification-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(90,242,214,0.2);
  position: absolute;
  top: 4px;
  right: 4px;
}
.icon-button {
  position: relative;
}

/* Popover */
.popover {
  position: absolute;
  top: 56px;
  right: 16px;
  min-width: 260px;
  background: #0b0e1a;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  display: none;
  z-index: 30;
}
.popover.is-open {
  display: block;
}

.notifications-popover {
  right: 72px;
}
.profile-popover {
  right: 20px;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 6px;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 12px;
  color: var(--color-text-soft);
}
.popover-body {
  max-height: 260px;
  overflow: auto;
  padding: 4px 2px;
}
.popover-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--color-text-soft);
  font-size: 13px;
  cursor: pointer;
}
.popover-item:hover {
  background: rgba(255,255,255,0.04);
}
.popover-item.danger {
  color: var(--color-danger);
}

/* Profile chip */
.topbar-profile {
  position: relative;
}
.profile-chip {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: radial-gradient(circle at 0 0,rgba(90,242,214,0.16),transparent 60%),
              rgba(8,12,30,0.96);
  padding: 4px 8px 4px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--color-text-soft);
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(145deg,#5af2d6,#7b7cff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #050711;
  font-size: 13px;
  font-weight: 700;
}
.avatar.small {
  width: 24px;
  height: 24px;
  font-size: 11px;
}
.profile-meta {
  display: flex;
  flex-direction: column;
}
.profile-name {
  font-size: 13px;
}
.profile-role {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Layout principal */
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 230px minmax(0,1fr) 260px;
  height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
  border-right: 1px solid rgba(255,255,255,0.03);
  background: linear-gradient(180deg,rgba(6,10,30,0.98),rgba(4,6,18,0.98));
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.sidebar-section {
  margin-bottom: var(--space-md);
}
.sidebar-top {
  flex: 1;
}
.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-left: 12px;
  margin-bottom: 6px;
  display: block;
}
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-link {
  width: 100%;
  border-radius: 999px;
  border: none;
  background: transparent;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.04);
}
.sidebar-link.is-active {
  background: linear-gradient(90deg,rgba(90,242,214,0.2),rgba(123,124,255,0.25));
  color: var(--color-text);
}
.sidebar-icon {
  width: 22px;
  display: inline-flex;
  justify-content: center;
}
.sidebar-icon i {
  font-size: 14px;
}
.sidebar-text {
  white-space: nowrap;
}

/* Sidebar colapsada */
.app-layout.sidebar-collapsed .sidebar {
  width: 60px;
  padding-inline: 6px;
}
.app-layout.sidebar-collapsed .sidebar-text,
.app-layout.sidebar-collapsed .sidebar-label,
.app-layout.sidebar-collapsed .role-widget {
  display: none;
}
.app-layout.sidebar-collapsed {
  grid-template-columns: 60px minmax(0,1fr) 280px;
}

/* Role widget */
.role-widget .role-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15,20,50,0.8);
  margin-bottom: var(--space-sm);
}
.role-name {
  font-size: 12px;
}
.role-level {
  font-size: 11px;
  color: var(--color-accent);
}
.trust-meter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trust-label {
  font-size: 11px;
  color: var(--color-text-muted);
}
.trust-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.trust-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg,#7b7cff,#5af2d6);
  transition: width 260ms ease-out;
}
.trust-score-label {
  font-size: 11px;
  color: var(--color-text-soft);
}

/* Main */
.main {
  padding: var(--space-xl);
  overflow: auto;
  background:
    radial-gradient(circle at 0 0,rgba(90,242,214,0.08),transparent 55%),
    radial-gradient(circle at 100% 110%,rgba(123,124,255,0.08),transparent 55%),
    linear-gradient(120deg,#050711,#050711);
}

/* Secondary panel */
.secondary-panel {
  border-left: 1px solid rgba(255,255,255,0.03);
  background: radial-gradient(circle at 110% -10%,rgba(123,124,255,0.24),transparent 55%),
              rgba(7,10,25,0.98);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  overflow: auto;
}
.secondary-section h3 {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}
.vertical-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.vertical-list-item {
  border-radius: 12px;
  border: 1px solid var(--color-border-subtle);
  background: rgba(255,255,255,0.02);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--color-text-soft);
}

/* System status */
.system-status-widget {
  border-radius: 14px;
  border: 1px solid rgba(90,242,214,0.4);
  background: radial-gradient(circle at 0 0,rgba(90,242,214,0.22),transparent 60%),
              rgba(4,8,24,0.95);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--color-text-soft);
}

/* ------------------------------
   Componentes compartilhados
---------------------------------*/
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}
.page-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  color: #f5f7ff;
  letter-spacing: 0.02em;
}
.page-subtitle {
  font-size: 13px;
  color: #a7b3d9;
}
.breadcrumbs {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Quick actions */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Cards */
.card {
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg,#0b0e1a,#080a14);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-inner);
  padding: var(--space-lg);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}
.card-title {
  font-size: 14px;
}
.card-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: var(--space-md);
}
@media (max-width: 1280px) {
  .card-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
@media (max-width: 880px) {
  .app-layout {
    grid-template-columns: 60px minmax(0,1fr);
  }
  .secondary-panel {
    display: none;
  }
}

/* Status cards */
.status-card {
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: radial-gradient(circle at 0 0,rgba(90,242,214,0.28),transparent 60%),
              rgba(5,7,18,0.96);
  border: 1px solid rgba(90,242,214,0.4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.status-label {
  font-size: 11px;
  color: var(--color-text-muted);
}
.status-value {
  font-size: 20px;
  font-weight: 600;
}
.status-meta {
  font-size: 11px;
  color: var(--color-text-soft);
}

/* Badge / Tag */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.badge.subtle {
  border-color: rgba(255,255,255,0.08);
  color: var(--color-text-muted);
  background: rgba(255,255,255,0.02);
}
.badge.accent {
  border-color: rgba(90,242,214,0.6);
  background: rgba(90,242,214,0.16);
  color: var(--color-accent-strong);
}
.badge.danger {
  border-color: rgba(255,85,119,0.6);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.badge.success {
  border-color: rgba(51,214,159,0.6);
  background: rgba(51,214,159,0.16);
  color: var(--color-success);
}
.badge.muted {
  border-color: rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.01);
  color: var(--color-text-muted);
}

/* Tabelas modernas */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead {
  background: rgba(255,255,255,0.02);
}
.table th,
.table td {
  padding: 8px 10px;
  text-align: left;
}
.table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  margin-bottom: var(--space-md);
}
.tab-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  border-radius: 999px;
  cursor: pointer;
}
.tab-btn.is-active {
  background: rgba(90,242,214,0.12);
  color: var(--color-accent);
}
.tab-panel {
  display: none;
}
.tab-panel.is-active {
  display: block;
}

/* Empty state */
.empty-state {
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255,255,255,0.12);
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-soft);
  background: rgba(255,255,255,0.02);
}
.empty-state h3 {
  margin-top: 0;
  margin-bottom: 4px;
}
.empty-state p {
  font-size: 13px;
  margin-bottom: var(--space-md);
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  z-index: 50;
}
.toast {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(9,13,38,0.96);
  border: 1px solid rgba(90,242,214,0.5);
  color: var(--color-text-soft);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: toast-in 200ms ease-out;
}
.toast.danger {
  border-color: rgba(255,85,119,0.7);
  background: rgba(60,6,20,0.98);
}
.toast-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(90,242,214,0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.toast-message {
  white-space: nowrap;
}
.toast-close {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
}

@keyframes toast-in {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal & Drawer */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2,4,15,0.72);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
  z-index: 40;
}
.overlay-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
}
.modal.is-hidden {
  display: none;
}
.modal-content {
  width: min(480px,90vw);
  background: #0b0e1a;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-soft);
  padding: var(--space-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.modal-body {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}
.modal-footer {
  margin-top: var(--space-md);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* Drawer */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(460px,100vw);
  display: flex;
  justify-content: flex-end;
  z-index: 45;
}
.drawer.is-hidden {
  display: none;
}
.drawer-content {
  background: #0b0e1a;
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -24px 0 48px rgba(0,0,0,0.75);
  width: 100%;
  display: flex;
  flex-direction: column;
}
.drawer-header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border-subtle);
}
.drawer-body {
  padding: var(--space-lg);
  overflow: auto;
  flex: 1;
}
.drawer-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg,rgba(255,255,255,0.06),rgba(255,255,255,0.02),rgba(255,255,255,0.06));
  background-size: 200% 100%;
  animation: skeleton 1.3s infinite ease-out;
  border-radius: 999px;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Timeline / Recent activity */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline-item {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--color-text-soft);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-accent);
}
.timeline-item::after {
  content: "";
  position: absolute;
  left: 8.5px;
  top: 10px;
  width: 1px;
  height: calc(100% - 10px);
  background: rgba(255,255,255,0.08);
}

/* Forms inline / filtros */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.filter-pill {
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background: rgba(255,255,255,0.02);
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-soft);
}

/* Badges de severidade / prioridade */
.badge.severity-low { background: rgba(51,214,159,0.16); color: var(--color-success); }
.badge.severity-medium { background: rgba(255,200,87,0.16); color: var(--color-warning); }
.badge.severity-high { background: rgba(255,145,77,0.2); color: #ff914d; }
.badge.severity-critical { background: var(--color-danger-soft); color: var(--color-danger); }

/* Grid da dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-lg);
}
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* My Work list */
.simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.simple-list-item {
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

/* Metrics canvas wrapper */
.metrics-graphs {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: var(--space-md);
}
@media (max-width: 1040px) {
  .metrics-graphs {
    grid-template-columns: 1fr;
  }
}
.metrics-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: rgba(255,255,255,0.02);
  padding: var(--space-md);
}

/* RBAC tooltip */
.rbac-disabled {
  position: relative;
  cursor: not-allowed !important;
}
.rbac-disabled::after {
  content: attr(data-rbac-tooltip);
  position: absolute;
  white-space: nowrap;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9,13,36,0.98);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--color-text-soft);
  font-size: 11px;
  border-radius: 999px;
  padding: 4px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.rbac-disabled:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Responsividade geral */
@media (max-width: 960px) {
  .topbar {
    padding-inline: var(--space-md);
  }
  .topbar-left {
    gap: var(--space-md);
  }
  .topbar-search {
    display: none;
  }
}
@media (max-width: 720px) {
  .app-layout {
    grid-template-columns: 0 minmax(0,1fr);
  }
  .sidebar {
    display: none;
  }
}