:root{
  --bg: #0b1220;
  --surface: #0f1a2e;
  --surface-2: #101f36;
  --text: #e7eefc;
  --muted: rgba(231,238,252,.72);
  --border: rgba(231,238,252,.12);
  --primary: #4f86ff;
  --primary-2: #7aa2ff;
  --danger: #ff4d4f;
  --shadow: 0 12px 30px rgba(0,0,0,.18);
}

/* Tema claro padrão */
html[data-theme="light"]{
  --bg: #eef2ff;
  --surface: #ffffff;
  --surface-2: #f7f8ff;
  --text: #0f172a;
  --muted: rgba(15,23,42,.68);
  --border: rgba(15,23,42,.10);
  --primary: #2563eb;
  --primary-2: #3b82f6;
  --shadow: 0 12px 30px rgba(2,6,23,.10);
}

/* Tema escuro */
html[data-theme="dark"]{
  --bg: #0b1220;
  --surface: #0f1a2e;
  --surface-2: #101f36;
  --text: #e7eefc;
  --muted: rgba(231,238,252,.72);
  --border: rgba(231,238,252,.12);
  --primary: #4f86ff;
  --primary-2: #7aa2ff;
  --shadow: 0 12px 30px rgba(0,0,0,.25);
}

body{
  background: var(--bg);
  color: var(--text);
}

/* Background do app (mais "SaaS") */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
      radial-gradient(900px 600px at 10% 10%, rgba(79,134,255,.22), transparent 60%),
      radial-gradient(700px 520px at 85% 20%, rgba(122,85,217,.18), transparent 55%);
  opacity: .9;
  z-index: 0;
}
.app-shell, .auth-shell-v2{ position: relative; z-index: 1; }

/* Bootstrap tweaks */
.text-bg-primary{ background-color: var(--primary) !important; }
.btn-primary{
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover{
  background-color: var(--primary-2);
  border-color: var(--primary-2);
}
.card{
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card.soft{
  background: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%);
}
.card-titleline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.badge-soft{
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}
.table{
  color: var(--text);
}
.table > :not(caption) > * > *{
  background-color: transparent;
  border-bottom-color: var(--border);
}
.form-control, .form-select{
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.form-control:focus, .form-select:focus{
  border-color: rgba(79,134,255,.55);
  box-shadow: 0 0 0 .25rem rgba(79,134,255,.20);
}
.alert{
  border: 1px solid var(--border);
}

/* Auth */
.bg-auth{
  background:
      radial-gradient(900px 600px at 10% 15%, rgba(47,74,217,.55), transparent 60%),
      radial-gradient(700px 520px at 85% 20%, rgba(122,85,217,.45), transparent 55%),
      radial-gradient(520px 420px at 85% 80%, rgba(255,255,255,.12), transparent 60%),
      linear-gradient(135deg, #2f4ad9 0%, #7a55d9 100%);
  background-size: 140% 140%;
  animation: authGradient 16s ease-in-out infinite;
}

/* Auth v2 (estilo do print: duas colunas) */
.auth-shell-v2{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
}
.auth-surface{
  width: min(1180px, 100%);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: auto;
}
.auth-left{
  position: relative;
  background: linear-gradient(135deg, #2f4ad9 0%, #7a55d9 100%);
  background-size: 140% 140%;
  animation: authGradient 18s ease-in-out infinite;
  color: #fff;
  padding: 42px 44px;
  display: flex;
  align-items: center;
}
.auth-left-inner{
  position: relative;
  z-index: 2;
  max-width: 440px;
}
.auth-logo{
  height: 104px;
  width: auto;
  display: inline-block;
  margin-bottom: 18px;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.25));
  transform-origin: center;
  animation: authFloat 5.5s ease-in-out infinite;
}
.auth-logo{
  max-width: 280px;
}
.auth-left-title{
  font-weight: 900;
  letter-spacing: .02em;
  font-size: 2.4rem;
  line-height: 1.05;
}
.auth-left-subtitle{
  margin-top: 10px;
  opacity: .9;
  font-size: 1.05rem;
}
.auth-left-list{
  margin-top: 28px;
  display: grid;
  gap: 12px;
  opacity: .95;
}
.auth-left-item{
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 600;
}
.auth-left-item i{
  font-size: 1.1rem;
  opacity: .95;
}
.auth-blob{
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: .18;
  background: rgba(255,255,255,.65);
  animation: blobMove 10s ease-in-out infinite;
}
.blob-1{
  width: 360px;
  height: 360px;
  left: -120px;
  top: -120px;
}
.blob-2{
  width: 260px;
  height: 260px;
  right: -100px;
  bottom: -120px;
  animation-delay: 1.8s;
}
.auth-right{
  padding: 48px 54px;
  background: color-mix(in srgb, var(--surface) 92%, #ffffff 8%);
}
.auth-right-inner{
  max-width: 460px;
  margin: 0 auto;
}
.auth-right h1{
  font-weight: 900;
  letter-spacing: -0.02em;
}
.auth-right .form-label{
  font-weight: 600;
  color: var(--muted);
}
.auth-right .btn-primary{
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
}
.auth-footer{
  margin-top: auto;
  padding-top: 14px;
  text-align: center;
  opacity: .9;
}

@keyframes authGradient{
  0%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}
@keyframes authFloat{
  0%,100%{ transform: translateY(0px); }
  50%{ transform: translateY(-6px); }
}
@keyframes blobMove{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(10px, -10px) scale(1.05); }
}

.auth-input{
  border-radius: 14px;
  padding: 12px 14px;
}
.auth-input-group{
  border-radius: 14px;
  overflow: hidden;
}
.auth-input-group .input-group-text{
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
}
.auth-input-group .form-control{
  border-left: 0;
}
.auth-input-group .btn{
  border-color: var(--border);
}

@media (max-width: 992px){
  .auth-surface{ grid-template-columns: 1fr; }
  .auth-left{ padding: 30px; }
  .auth-right{ padding: 26px 22px; }
  .auth-left-title{ font-size: 2rem; }
}

@media (max-width: 480px){
  .auth-logo{ height: 86px; }
  .auth-right-inner{ max-width: 100%; }
}

/* App shell */
.app-shell{
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 14px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, #000 12%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-brand{
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}
.brand-mark{
  height: 40px;
  width: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, #2f4ad9 0%, #7a55d9 100%);
  box-shadow: 0 14px 26px rgba(0,0,0,.18);
}
.brand-meta{ min-width: 0; }
.brand-title, .brand-subtitle{ line-height: 1.15; }
.sidebar-logo{
  height: 40px;
  width: auto;
  max-width: 150px;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.18));
}
.brand-title{ font-weight: 900; letter-spacing: -.02em; }
.brand-subtitle{ color: var(--muted); font-size: .82rem; }
.sidebar-nav{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}
.sidebar-nav .nav-link{
  border-radius: 10px;
  padding: 10px 10px;
  color: var(--text);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-nav .nav-link i{ opacity: .9; }
.sidebar-nav .nav-link span{ flex: 1; }
.sidebar-nav .nav-link:hover{
  border-color: var(--border);
  background: var(--surface-2);
}
.sidebar-nav .nav-link.active{
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 22%, transparent), color-mix(in srgb, #7a55d9 18%, transparent));
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}
.nav-section{
  margin-top: 10px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 6px 10px 0;
}
.sidebar-footer{
  margin-top: auto;
  padding: 6px;
}
.main{
  display: flex;
  flex-direction: column;
}
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar-title{
  font-weight: 800;
}
.topbar-left{
  display: flex;
  gap: 10px;
  align-items: center;
}
.topbar-right{
  display: flex;
  gap: 10px;
  align-items: center;
}

.app-footer{
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  backdrop-filter: blur(10px);
}

/* Tabelas mais "SaaS" */
.table thead th{
  color: var(--muted);
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom-color: var(--border) !important;
}
.table tbody tr:hover{
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

@media (max-width: 992px){
  .app-shell{ grid-template-columns: 1fr; }
  .sidebar{
    position: relative;
    height: auto;
  }
}

