:root {
  --accent: #e94560;
  --sidebar-width: 240px;
  --sidebar-collapsed: 60px;
}

body {
  min-height: 100vh;
  background: #1a1a2e;
  overflow: hidden;
}

/* ── Layout principal ── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar desktop ── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 0.3s ease, min-width 0.3s ease;
  z-index: 1020;
  overflow: hidden;
  flex-shrink: 0;
}

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

.sidebar.collapsed .sidebar-text {
  display: none;
}

.sidebar.collapsed .sidebar-user .badge {
  display: none;
}

.sidebar.collapsed .sidebar-header a {
  justify-content: center;
}

.sidebar-header a {
  display: flex;
  align-items: center;
}

/* Links da sidebar */
.sidebar-link {
  color: #a8a8b3;
  border-radius: 0.5rem;
  margin: 0 0.5rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  color: #e4e4e4;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(233, 69, 96, 0.15);
  border-left: 3px solid var(--accent);
}

/* ── Main content ── */
.main-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  transition: margin-left 0.3s ease;
}

/* ── Forms ── */
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 0.25);
  border-color: var(--accent);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* ── Mobile offcanvas ── */
.offcanvas .nav-link {
  color: #a8a8b3;
  transition: all 0.2s;
}

.offcanvas .nav-link:hover,
.offcanvas .nav-link.active {
  color: #fff;
  background: rgba(233, 69, 96, 0.15);
}

/* ── Tooltip fix para sidebar collapsed ── */
.sidebar.collapsed [data-bs-toggle="tooltip"] {
  pointer-events: auto;
}

/* ── Mobile ── */
@media (max-width: 991px) {
  .app-layout {
    flex-direction: column;
    height: auto;
  }

  .main-content {
    height: calc(100vh - 56px);
  }
}
