:root {
  --app-bg: #f3f6fb;
  --app-panel: #ffffff;
  --app-primary: #1f7a8c;
  --app-primary-dark: #16606f;
  --app-secondary: #2d3a4b;
  --app-border: #e2e8f0;
  --app-muted: #6c7a89;
  --app-sidebar: #0f172a;
  --app-sidebar-accent: #1e293b;
  --app-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  color: #0f172a;
  background: radial-gradient(circle at top left, #eef3ff 0%, #f7f9fc 45%, #eef2f8 100%);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0f172a 0%, #111c33 100%);
  color: #e2e8f0;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f7a8c, #49c5b6);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #ffffff;
}

.brand-title {
  font-weight: 600;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.7);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav .nav-link {
  color: rgba(226, 232, 240, 0.75);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(73, 197, 182, 0.16);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.7);
}

.sidebar-meta {
  font-size: 0.8rem;
}

.badge-soft {
  background: rgba(31, 122, 140, 0.2);
  color: #8fe3de;
  border: 1px solid rgba(73, 197, 182, 0.35);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: var(--app-panel);
  border-bottom: 1px solid var(--app-border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title .title {
  font-weight: 600;
}

.topbar-title .subtitle {
  display: block;
  font-size: 0.85rem;
  color: var(--app-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  display: grid;
  place-items: center;
  background: #ffffff;
}

.btn-ghost {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--app-secondary);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.avatar-btn {
  border: 1px solid var(--app-border);
  background: #ffffff;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  padding: 0;
}

.avatar-btn:focus-visible {
  outline: 2px solid rgba(31, 122, 140, 0.35);
  outline-offset: 2px;
}

.avatar-btn.dropdown-toggle::after {
  display: none;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e2e8f0;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #1e293b;
}

.topbar-user .dropdown-menu {
  min-width: 180px;
  border-radius: 14px;
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  padding: 8px;
}

.topbar-user .dropdown-header {
  font-size: 0.8rem;
  color: var(--app-muted);
  padding: 4px 8px 6px;
}

.topbar-user .dropdown-item {
  border-radius: 10px;
  padding: 8px 12px;
}

.topbar-user .dropdown-item i {
  font-size: 1rem;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-name {
  font-weight: 600;
}

.user-role {
  font-size: 0.78rem;
  color: var(--app-muted);
}

.content {
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--app-muted);
}

.card {
  border: 1px solid var(--app-border);
  border-radius: 18px;
  box-shadow: var(--app-shadow);
}

.card-stat {
  background: var(--app-panel);
}

.card-stat .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 8px 0 4px;
}

.stat-meta {
  font-size: 0.85rem;
  color: var(--app-muted);
}

.bg-soft-success {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.bg-soft-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.bg-soft-info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.bg-soft-primary {
  background: rgba(31, 122, 140, 0.18);
  color: var(--app-primary);
}

.card-export .btn {
  border-radius: 12px;
}

.data-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--app-border);
}

.table {
  margin-bottom: 0;
}

.status-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
}

.status-active {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.status-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.action-btns {
  display: flex;
  gap: 6px;
}

td {
  font-size: 0.8rem;
  /* Se maior que 50 caracteres ... */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-btns .btn {
  border-radius: 10px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 10px;
  border: 1px solid var(--app-border);
  padding: 6px 10px;
}

.dataTables_wrapper .dataTables_paginate .page-link {
  border-radius: 10px;
  margin: 0 2px;
}

.toast-container .toast {
  border-radius: 14px;
}

.modal-content {
  border-radius: 18px;
  border: 1px solid var(--app-border);
}

.modal-header,
.modal-footer {
  border-color: var(--app-border);
}

.sidebar-collapsed .sidebar {
  width: 92px;
}

.sidebar-collapsed .nav-label,
.sidebar-collapsed .brand-text,
.sidebar-collapsed .sidebar-meta {
  display: none;
}

.sidebar-collapsed .sidebar-nav .nav-link {
  justify-content: center;
}

.sidebar-collapsed .sidebar-footer {
  align-items: center;
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.6s ease forwards;
}

.fade-up:nth-child(2) {
  animation-delay: 0.05s;
}

.fade-up:nth-child(3) {
  animation-delay: 0.1s;
}

.fade-up:nth-child(4) {
  animation-delay: 0.15s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-body {
  background: linear-gradient(140deg, #eef2ff 0%, #f8fafc 55%, #e2f7f4 100%);
}

.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: #ffffff;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.auth-brand h1 {
  margin: 0;
}

.auth-form .form-control {
  border-radius: 12px;
  padding: 10px 14px;
}

.auth-note {
  font-size: 0.85rem;
  color: var(--app-muted);
}

.auth-aside {
  padding: 64px 48px;
  background: linear-gradient(160deg, #1f2937 0%, #0f172a 80%);
  color: #e2e8f0;
  display: flex;
  align-items: center;
}

.auth-visual h2 {
  margin-top: 20px;
}

.auth-visual p {
  color: rgba(226, 232, 240, 0.75);
}

.visual-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(73, 197, 182, 0.2);
  color: #9ff2ea;
  font-weight: 600;
}

.auth-metrics {
  display: flex;
  gap: 24px;
  margin-top: 24px;
}

.metric {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}

.metric-label {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 20;
  }

  .sidebar-collapsed .sidebar {
    transform: translateX(0);
    width: 260px;
  }

  .content {
    padding: 20px;
  }

  .topbar {
    padding: 16px 20px;
  }
}

@media (max-width: 768px) {
  .auth-panel {
    padding: 32px 24px;
  }

  .auth-aside {
    padding: 40px 24px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
